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!