Announcements
Due to scheduled maintenance, the Autodesk Community will be inaccessible from 10:00PM PDT on Oct 16th for approximately 1 hour. We appreciate your patience during this time.
.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

PrintToFile creates postscript not pdf

0 REPLIES 0
Reply
Message 1 of 1
Anonymous
409 Views, 0 Replies

PrintToFile creates postscript not pdf

Hi All,

 

I know the 'how do I plot to PDF' is an FAQ but when I use PlotToFile with the Adobe PDF printer, the output .pdf file is a postscript file not a PDF file.  The beginning of the output file looks like this:

 

%!PS-Adobe-3.0
%%Title: BASE1 Model (1)
%%Creator: PScript5.dll Version 5.2.2
%%CreationDate: 6/13/2018 14:23:29
%%BoundingBox: (atend)
%%Pages: (atend)
%%Orientation: Portrait
%%PageOrder: Special
%%DocumentNeededResources: (atend)
%%DocumentSuppliedResources: (atend)
%%DocumentData: Clean7Bit
%%TargetDevice: (Adobe PDF) (3018.101) 0
%%LanguageLevel: 3
%%EndComments

 

 

Here's the code:

 

function printDwg($path)
{
    $app = New-Object -ComObject "AutoCAD.Application"
    $doc = $app.Documents.Open("$path\Base1.dwg")
    $doc.ActiveLayout.ConfigName = "Adobe PDF"
    $plot = $doc.Plot()
    $plot.PlotToFile("$path\Base1.pdf")
    #$plot.PlotToDevice($null)
}

At the moment I'm using powershell but could use C# if need be.  The question is probably to do w/ the COM API not the particular client language, and I didn't see any board specific to the COM API so I'm posting here - hope that's ok.  

 

Anyway, any thoughts on what I should try?

 

Thanks!

0 REPLIES 0

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

AutoCAD Inside the Factory


Autodesk Design & Make Report