Impose a PDF name

Impose a PDF name

Anonymous
Not applicable
640 Views
11 Replies
Message 1 of 12

Impose a PDF name

Anonymous
Not applicable
Hi,

I'm using the line :

plotted = objPlot.PlotToDevice("ScanSoft PDF Create!.pc3")

To plot the current layout, but is it possible to impose a PDF filename
either to in this case Scansoft create or Adobe.

And skip the driver to ask me for the file name.

Thanks.
0 Likes
641 Views
11 Replies
Replies (11)
Message 2 of 12

HJohn1
Advocate
Advocate
You could try

objPlot.PlotToFile "YourName" & ".pdf", yourPDF_PC3

Hope it helps.
0 Likes
Message 3 of 12

Anonymous
Not applicable

Hi,

 

It does the same thing, the driver still prompts me
for the file name...

 

 


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
You
could try objPlot.PlotToFile "YourName" & ".pdf", yourPDF_PC3 Hope it
helps.
0 Likes
Message 4 of 12

arcticad
Advisor
Advisor
You need to create the file as a Post Script File and then

Convert the file to a PDF File. This will allow you to create the file

without being prompted for a filename.

{code}
Sub CreatePDF()

' Add a reference to Acrobat Distiller
Dim myPDF As PdfDistiller
Set myPDF = New PdfDistiller

Dim PtObj As AcadPlot
Set PtObj = ThisDrawing.Plot
Dim PlotConfig As AcadPlotConfiguration
Set PlotConfig = ThisDrawing.ActiveLayout

Dim PSName As String
Dim PDFName As String

Dim cPDF As Boolean

PSName = "c:\PSFILE.PS"
PDFName = "c:\PDFFILE.PDF"

' You need to plot the File as a post script file
If PtObj.PlotToFile(PSName, PlotConfig.ConfigName) Then
' Then Convert that file to a PDF File
cPDF = myPDF.FileToPDF(PSName, PDFName, "")
If cPDF = False Then
MsgBox "Error Creating File"
End If
Kill PSName
End If

End Sub
{code}
---------------------------



(defun botsbuildbots() (botsbuildbots))
0 Likes
Message 5 of 12

HJohn1
Advocate
Advocate
Use the full name. Path + name + extension, "C:\myfilename.pdf"
0 Likes
Message 6 of 12

arcticad
Advisor
Advisor
objPlot.PlotToFile will not create a PDF file.

It will only create a Post Script file. regardless of the extension.
---------------------------



(defun botsbuildbots() (botsbuildbots))
0 Likes
Message 7 of 12

Anonymous
Not applicable
easy fix with registry settings for adobe acrobat and other similar programs
see http://discussion.autodesk.com/forums/thread.jspa?messageID=6089556
0 Likes
Message 8 of 12

Anonymous
Not applicable
Hi arcticad,

I have a series of files created with objPlot.PlotToFile

They have an extension of PDF.

They open in Acrobat and Foxit Viewer and exhibit all the expected
behaviour of PDF files.

Are you trying to tell me that they are Post Script Files?

Unfortunately they are too big to post to allow you to personally review.

Regards


Laurie Comerford

arcticad wrote:
> objPlot.PlotToFile will not create a PDF file. It will only create a
> Post Script file. regardless of the extension.
0 Likes
Message 9 of 12

HJohn1
Advocate
Advocate
achticad I have been using this approach for some time now, I worked the routine from some help I got here and as Laurie mentioned it works just fine. I have never created a post script file to plot to pdf. I am using AutoCAD 2007 and the provided DWG to PDF.pc3 driver.
0 Likes
Message 10 of 12

Anonymous
Not applicable
i imagine it depends on what version of autocad you have and whether you are able to plot to a pdf in autocad without having adobe acrobat or similar installed... (as john mentions below the DWG to PDF.pc3 provided) Edited by: cadger on Feb 4, 2009 3:04 AM
0 Likes
Message 11 of 12

arcticad
Advisor
Advisor
Alright I'll concede that you can do stuff with pc3 files.
---------------------------



(defun botsbuildbots() (botsbuildbots))
0 Likes
Message 12 of 12

Anonymous
Not applicable

Hi,

 

PtObj.PlotToFile(PSName, PlotConfig.ConfigName)

 

In the plotconfig.configname, what is suppose to be
the value, I don't have a PC3 creating a PS file, I only have listed my
printers, Adobe, and ScanSoft create...

 

Thanks.


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
You
need to create the file as a Post Script File and then Convert the file to a
PDF File. This will allow you to create the file without being prompted for a
filename. {code} Sub CreatePDF() ' Add a reference to Acrobat Distiller Dim
myPDF As PdfDistiller Set myPDF = New PdfDistiller Dim PtObj As AcadPlot Set
PtObj = ThisDrawing.Plot Dim PlotConfig As AcadPlotConfiguration Set
PlotConfig = ThisDrawing.ActiveLayout Dim PSName As String Dim PDFName As
String Dim cPDF As Boolean PSName = "c:\PSFILE.PS" PDFName = "c:\PDFFILE.PDF"
' You need to plot the File as a post script file If PtObj.PlotToFile(PSName,
PlotConfig.ConfigName) Then ' Then Convert that file to a PDF File cPDF =
myPDF.FileToPDF(PSName, PDFName, "") If cPDF = False Then MsgBox "Error
Creating File" End If Kill PSName End If End Sub
{code}
0 Likes