Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results forĀ 
ShowĀ Ā onlyĀ  | Search instead forĀ 
Did you mean:Ā 

iLogic printing error

5 REPLIES 5
Reply
Message 1 of 6
S7RM7RPR
409 Views, 5 Replies

iLogic printing error

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)
5 REPLIES 5
Message 2 of 6
S7RM7RPR
in reply to: S7RM7RPR

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.

Message 3 of 6
S7RM7RPR
in reply to: S7RM7RPR

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.

Message 4 of 6
gavbath
in reply to: S7RM7RPR

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


   

Message 5 of 6
MegaJerk
in reply to: gavbath

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? 

 

 



If my solution worked or helped you out, please don't forget to hit the kudos button šŸ™‚
iLogicCode Injector: goo.gl/uTT1IB

GitHub
Message 6 of 6
DRLTKSE
in reply to: MegaJerk

I use a free bit of software called bullzip which sets up a printer and you can specify where the pdf printer out puts to. This is usefull if you print your pdfs to the same location over and over and avoids the "Save As" dialog

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

Post to forums  

Autodesk Design & Make Report