Hi,
I have a very annoying and costly issue that I hope you all can help with. Let me try to succinctly state the two root issues without the background saga...
1) When programmatically creating PDF files of drawings from a VB.NET AddIn, via a ModelDoc2.SaveAs4 function, about 15% of the time (or 90% if the drawing is large and/or 'hot'), the resulting PDF file is missing some annotations. For example, one sheet might be missing a Cage Code, or the text will be missing from the Item Balloons, or one line will be missing from the drawing notes. Very random, not at all repeatable, and all the annotations are present in the native SolidWorks drawing file! Argh.
The code used is:
bReturn = myActiveDoc.SaveAs4("C:\temp.pdf", swSaveAsCurrentVersion, 0, lFileError, lngFileWarning)
2) In an attempt to fix root issue 1), I'm trying to automate Printing to the Adobe PDF printer. The catch is I don't want the user to have to input a filename - I want to control the name and where it goes (this is all part of a much larger automation... function). While I can get this to work with the PrintOut2 function, from either the ModelDoc2 or ModelDocExtension objects, whenever I try to give it a filename and tell it to print to a file in the code, it creates a file however it's not an Adobe file (right extension but Adobe won't open it, and is 10x larger than a comparable Adobe file). If I omit the print to file and/or filename, it prompts the user for a filename, and successfully creates a valid PDF file - however this is significantly less than desirable for long winded reasons I won't go into other than to say I don't want to user to have to do anything (thus break anything) in this process.
The code used here is:
myActiveDoc.PrintOut2(0, 0, 1, False, "Adobe PDF", 0, True, "C:\Test2.pdf")
Does anyone have any experience with Issue #1 and a possible solution (other than to Print to the Adobe PDF printer)?
If not, can anyone successfully (e.g., you can open the resulting PDF with Adobe) Print to the Adobe PDF printer (as opposed to SaveAs) in an automated fashion where you specify the filename in the code and the user doesn't have to do anything?
p.s. I'm using x64 SW2009, SP4.0, VB.NET 2010