Print to .pdf using COM

Print to .pdf using COM

NirantarVidyarthee
Advocate Advocate
1,210 Views
0 Replies
Message 1 of 1

Print to .pdf using COM

NirantarVidyarthee
Advocate
Advocate

Hello,

 

Based on the blog post 'Use EXPORTPDF / EXPORTDWF / EXPORTDWFX programmatically' <http://adndevblog.typepad.com/autocad/2012/07/use-exportpdf-exportdwf-exportdwfx-programmatically.ht...> by Adam Nagy, I ran this VBA code in AutoCAD 2014 but it does not generate the pdf file.
AutoCAD says errors and warning found but it is blank.

 

Public Sub Test()
ThisDrawing.SendCommand ("filedia 0 ")
Dim varFile As String
varFile = "D:\PDftry\Angletry.pdf"
ThisDrawing.SendCommand ("_-EXPORT" & vbCr & "PDF" & vbCr & "Extents" & vbCr & "No" & vbCr & varFile & vbCr)
End Sub

 

When I run the same command on command line it works. 

 

The same thing happens when I use COM API in VB.Net.

It seems COM API can not create .pdf. Or am I missing something?

 
0 Likes
1,211 Views
0 Replies
Replies (0)