I am making what seems to be a rather vain and valiant attempt at having iLogic generate pdfs for me. From my research I cannot use the "saveas" because then I get layers on my pdf and I can't appear to turn that off so I am left with printing. I have finally come up with code that allows me to print to file and specify the name of the file (which I can't seem to do through regualr printing to pdf), but when the pdf generates, adobe tells me the pdf is corrupt and I cannot open it. Any thoughts anyone?
Dim oDrawDoc As Document oDrawDoc = ThisApplication.ActiveDocument Dim oPrintMgr As PrintManager oPrintMgr = oDrawDoc.PrintManager oPrintMgr.Printer = "Adobe PDF" oPrintMgr.AllColorsAsBlack = True oPrintMgr.ColorMode = kPrintDefaultColorMode oPrintMgr.Orientation = kLandscapeOrientation oPrintMgr.PaperSize = SizeActiveSheet Dim FILENAME As String FILENAME = "**\B SIZE.pdf" oPrintMgr.PrintToFile(FILENAME)
Update - I've been messing around with the drivers and that seems to be the culprit but I have yet to come up with a workable solution. After reinstalling Adobe drivers it refuses to print automatically at all now and crashes Inventor.
Update - I have done a complete reinstall and update of Adobe 11 pro as well as updated Inventor and the windows printer drivers and now I am back to the original problem of having corrupted pdfs when I use iLogic.. I think my next step is not using Adobe which is going to create other problems... but I digress.
Don't go down that track yet. I just tried your code with Cute PDF writer and experience the same issue.
Something is not working correctly with the PrintToFile method, but I haven't figured out what yet.
Interestingly, if I use the "SubmitPrint" method of the PrintManager object, then I get a PDF that opens and has the part displayed on it, but the title block is missing.
Gavin Bath
MFG / CAM Technical Specialist
Design and Motion Blog
Facebook | Twitter | LinkedIn | YouTube
Anyone figure out a solution to the PrintToFile method for the PrintManager.
It would seem that there is no good information on the forums other than people not being able to use it to accomplish the simple task of skipping the SaveAs dialog.
The only thing it does for me is error out saying "When you create a PostScript file you must rely on system fonts and use document fonts. Please go to the printer properties, "Adobe PDF Settings" page and turn OFF the option "Rely on system fonts only; do not use document fonts."" Changing this option creates a PDF file that is not recognized by Adobe Acrobat (or any other pdf reader for that matter) š
Question to Autodesk : Is this method broken, or are we just using it completely inappropriately?