Print/Save to PDF Issue
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I am simply trying to print or save an Inventor .DWG file to a .PDF file via C# - the issue being that the .PDF page size must correspond to the active sheet size in Inventor.
When I try printing to a PDF using:
oPrint.Printer = "Adobe PDF";
oPrint.ScaleMode = PrintScaleModeEnum.kPrintBestFitScale;
oPrint.PaperSize = PaperSizeEnum.kPaperSize11x17;
oPrint.Orientation = PrintOrientationEnum.kLandscapeOrientation;
oPrint.SetSheetRange(1, 1);
oPrint.PrintRange = PrintRangeEnum.kPrintSheetRange;
oPrint.SubmitPrint();
I get a message saying I have to uncheck "Rely on system fonts only; do not use document fonts." in the Adobe PDF settings. Is there a way to do this programmatically?
When I export to PDF using:
TranslatorAddIn PDFAddin = (TranslatorAddIn)instance.ApplicationAddIns.get_ItemById("{0AC6FD96-2F4D-42CE-8BE0-8AEA580399E4}");
TranslationContext oContext = instance.TransientObjects.CreateTranslationContext();
oContext.Type = IOMechanismEnum.kFileBrowseIOMechanism;
NameValueMap oOptions = instance.TransientObjects.CreateNameValueMap();
DataMedium oData = instance.TransientObjects.CreateDataMedium();
oOptions.set_Value("Sheet_Range", PrintRangeEnum.kPrintCurrentSheet);
oData.FileName = @"C:\Users\bsmith\Desktop\test.pdf";
PDFAddin.SaveCopyAs(oDoc, oContext, oOptions, oData);
This works but I cannot set the PDF page size. Again, is there a way to do this programmatically?
I am using Inventor 2010, Adobe Acrobat 9 Pro, Windows 7, 64 bit.
Any help/suggestions would be greatly appreciated. Thank you.
