Message 1 of 7
PrintToFile returns, but doesn't create a file
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm using the Inventor API with C# and trying to get some drawings as PDFs. Unfortunately it just isn't saving the output file. The method returns as if it was successful, but there just isn't any output file. If I manually print to a file with the same settings from the UI it works as expected. And usually the PrintToFile will succeed for that specific file afterwards until I restart Inventor. So it feels like something is getting cached in the app, but I can't figure out what.
Here is a code snippet showing what I am doing:
var drawing = app.Documents.Open(drawingFile, false);
var printManager = drawing.PrintManager as DrawingPrintManager;
printManager.Printer = "Microsoft Print to PDF";
printManager.PrintRange = PrintRangeEnum.kPrintAllSheets;
printManager.ScaleMode = PrintScaleModeEnum.kPrintBestFitScale;
printManager.PrintToFile(pdfFile);