Message 1 of 6
Layers in PDF disappearing seemingly random when using PDF translator

Not applicable
07-05-2016
05:26 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I'm having an issue with using the PDF translator in Inventor 2015.
I'm using the below code to export PDF files of fabrication/assembly drawings.
TranslatorAddIn oTranslator = (TranslatorAddIn)m_InventorApp.ApplicationAddIns.get_ItemById("{0AC6FD96-2F4D-42CE-8BE0-8AEA580399E4}"); if (oTranslator != null) { TransientObjects oTranslatorObjects = m_InventorApp.TransientObjects; TranslationContext oTranslatorContext = oTranslatorObjects.CreateTranslationContext(); //These are the options used for exporting PDF. NameValueMap oTranslatorNameValueMap = oTranslatorObjects.CreateNameValueMap(); DataMedium oDataMedium = oTranslatorObjects.CreateDataMedium(); //Here we set the options. oTranslatorNameValueMap.set_Value("Sheet_Range", PrintRangeEnum.kPrintAllSheets); //These are additional options. oTranslatorNameValueMap.set_Value("Remove_Line_Weight", false); oTranslatorNameValueMap.set_Value("Vector_Resolution", 720); oTranslatorContext.Type = IOMechanismEnum.kFileBrowseIOMechanism; foreach (var workingFile in m_workingFiles) { try { var openedDoc = m_InventorApp.Documents.Open(workingFile.SourceFilePath, true); openedDoc.Update2(true); if (openedDoc != null) { //oDataMedium.FileName = workingFile.OutputFilePath; oDataMedium.FileName = workingFile.TempOutputFilePath; oTranslator.SaveCopyAs(m_InventorApp.ActiveDocument, oTranslatorContext, oTranslatorNameValueMap, oDataMedium); Logger.LogDebug("I've created PDF file " + workingFile.TempOutputFilePath);
Sometimes it gives proper results (rev01 attached) and sometimes it doesn't (rev02 attached). The difference I can see in the PDF is in the layers; Sometimes it doesn't export the Visible Narrow layer.
Does anybody know what's driving this difference? Or a workaround to how we could avoid it?
Thank you very much in advance.
/Klaas