dwg to pdf through code

dwg to pdf through code

Anonymous
Not applicable
321 Views
4 Replies
Message 1 of 5

dwg to pdf through code

Anonymous
Not applicable
Hi All,
I'm having the Acrobat PDFWriter. How can convert dwg to pdf
programmatically? I need to place this PDF to a predefined folder (for ex :
c:\temp) also through the code.
0 Likes
322 Views
4 Replies
Replies (4)
Message 2 of 5

Anonymous
Not applicable
This involves both the printer (acrobat pdfWriter) and your code,

First create a PC3 to setup acrobat correctly, then in your code set plot
object to plot that specific layout

"acaduser" a écrit dans le message de news:
D8EDE8171AA80B1D923AAED6E71BA45F@in.WebX.maYIadrTaRb...
> Hi All,
> I'm having the Acrobat PDFWriter. How can convert dwg to pdf
> programmatically? I need to place this PDF to a predefined folder (for ex
:
> c:\temp) also through the code.
>
>
>
0 Likes
Message 3 of 5

Anonymous
Not applicable
I'm using PDF writer 5. I created the pc3 file and I wrote the following
code. This will create report.plt file in the location c:\temp. But the
report.pdf file is created in some other location. That location is not
constant all the time. What am I doing wrong?

Set plotObj = ThisDrawing.Plot 'Create the plot object
Set ACADPref = ThisDrawing.Application.Preferences.output 'Get the output
preferences object
originalValue = ACADPref.DefaultOutputDevice 'Read the original value

ACADPref.DefaultOutputDevice = "Acrobat PDFWriter" 'Modify the
DefaultOutputDevice preference
blnOutPut = plotObj.PlotToFile("C:\temp\report", "C:\Program Files\AutoCAD
2000i\plotters\Acrobat PDFWriter.pc3")
If blnOutPut = False Then
MsgBox ("Can not convert to pdf file")
Exit Sub
End If
ACADPref.DefaultOutputDevice = originalValue

"Yves Allaire" wrote in message
news:5DC566E820967DE0AF8DE8A9FA751840@in.WebX.maYIadrTaRb...
> This involves both the printer (acrobat pdfWriter) and your code,
>
> First create a PC3 to setup acrobat correctly, then in your code set plot
> object to plot that specific layout
>
> "acaduser" a écrit dans le message de news:
> D8EDE8171AA80B1D923AAED6E71BA45F@in.WebX.maYIadrTaRb...
> > Hi All,
> > I'm having the Acrobat PDFWriter. How can convert dwg to pdf
> > programmatically? I need to place this PDF to a predefined folder (for
ex
> :
> > c:\temp) also through the code.
> >
> >
> >
>
>
0 Likes
Message 4 of 5

Anonymous
Not applicable
Any suggestions???????
"acaduser" wrote in message
news:3E94F991113E37F471E79A1FBB8A2FBB@in.WebX.maYIadrTaRb...
> I'm using PDF writer 5. I created the pc3 file and I wrote the following
> code. This will create report.plt file in the location c:\temp. But the
> report.pdf file is created in some other location. That location is not
> constant all the time. What am I doing wrong?
>
> Set plotObj = ThisDrawing.Plot 'Create the plot object
> Set ACADPref = ThisDrawing.Application.Preferences.output 'Get the
output
> preferences object
> originalValue = ACADPref.DefaultOutputDevice 'Read the original value
>
> ACADPref.DefaultOutputDevice = "Acrobat PDFWriter" 'Modify the
> DefaultOutputDevice preference
> blnOutPut = plotObj.PlotToFile("C:\temp\report", "C:\Program Files\AutoCAD
> 2000i\plotters\Acrobat PDFWriter.pc3")
> If blnOutPut = False Then
> MsgBox ("Can not convert to pdf file")
> Exit Sub
> End If
> ACADPref.DefaultOutputDevice = originalValue
>
> "Yves Allaire" wrote in message
> news:5DC566E820967DE0AF8DE8A9FA751840@in.WebX.maYIadrTaRb...
> > This involves both the printer (acrobat pdfWriter) and your code,
> >
> > First create a PC3 to setup acrobat correctly, then in your code set
plot
> > object to plot that specific layout
> >
> > "acaduser" a écrit dans le message de news:
> > D8EDE8171AA80B1D923AAED6E71BA45F@in.WebX.maYIadrTaRb...
> > > Hi All,
> > > I'm having the Acrobat PDFWriter. How can convert dwg to pdf
> > > programmatically? I need to place this PDF to a predefined folder (for
> ex
> > :
> > > c:\temp) also through the code.
> > >
> > >
> > >
> >
> >
>
>
0 Likes
Message 5 of 5

Anonymous
Not applicable
> Any suggestions???????
> > I'm using PDF writer 5. I created the pc3 file and I wrote the following
> > code. This will create report.plt file in the location c:\temp. But the
> > report.pdf file is created in some other location. That location is not
> > constant all the time. What am I doing wrong?
You need to figure out why the location is not constant. PDFWriter uses
Distiller which is configured thru the windows' printers. It has a watch
directory and an export directory. If the location is not constant, then
either there is more than one Distiller in use, or your users are
somehow redirecting. Which, all of this means that it would not appear
to be your code that is in error, but your environment.

===============================
Mike Tuersley
PhD @ CADalyst's AutoCAD Clinic
http://www.cadonline.com
0 Likes