Inventor Customization

Inventor Customization

Active Contributor
41 Posts
0 Kudos
Registered: ‎09-26-2007
Post 1 of 1

API - Export DWF as PDF - options

841 Views, 0 Replies
10-03-2011 02:45 PM

So there is plenty of information floating around that enables coders to export/save a file as a PDF.  My question is how can control the options for my export?


This is the code that I've been using from here

My question pertains to the highlighted marks. How to I know what the other options are? I see when I debug that there are 40 items in my options object but to access them I need to know the text based version of the property. Does anybody own a list of available options for PDF?


Ultimately, what I want to do is limit the layers on my PDF. More or less "flatten" the image so my layers don't show up 



Call PDFAddIn.SaveCopyAs(oDocument, oContext, oOptions, oDataMedium)
Dim PDFAddIn As TranslatorAddIn Set PDFAddIn = ThisApplication.ApplicationAddIns.ItemById("{0AC6FD96-2F4D-42CE-8BE0-8AEA580399E4}") 'Set a reference to the active document (the document to be published). Dim oDocument As Document Set oDocument = ThisApplication.ActiveDocument Dim oContext As TranslationContext Set oContext = ThisApplication.TransientObjects.CreateTranslationContext oContext.Type = kFileBrowseIOMechanism ' Create a NameValueMap object Dim oOptions As NameValueMap Set oOptions = ThisApplication.TransientObjects.CreateNameValueMap ' Create a DataMedium object Dim oDataMedium As DataMedium Set oDataMedium = ThisApplication.TransientObjects.CreateDataMedium ' Check whether the translator has 'SaveCopyAs' options If PDFAddIn.HasSaveCopyAsOptions(oDocument, oContext, oOptions) Then ' Options for drawings... oOptions.Value("All_Color_AS_Black") = 0 'oOptions.Value("Remove_Line_Weights") = 0 'oOptions.Value("Vector_Resolution") = 400 'oOptions.Value("Sheet_Range") = kPrintAllSheets 'oOptions.Value("Custom_Begin_Sheet") = 2 'oOptions.Value("Custom_End_Sheet") = 4 End If 'Set the destination file name oDataMedium.FileName = "c:\temp\" & Left(DocumentObject.DisplayName, Len(DocumentObject.DisplayName) - 4) & " (REV " & ".pdf" 'Publish document. 
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Are you interested in helping shape the future of the Autodesk Community? To participate in this brief usability study, please click here. Your time and input is greatly appreciated!