iLogic batch PDF drawings - faded lines

iLogic batch PDF drawings - faded lines

Anonymous
Not applicable
670 Views
5 Replies
Message 1 of 6

iLogic batch PDF drawings - faded lines

Anonymous
Not applicable

When I batch drawings to PDF's from an assembly using iLogic, the lines on the PDF are barely visible.

Here is an example of what results I'm getting:

2018-07-26_13h37_57.png

 

I've tried playing around with:

oOptions.Value("Remove_Line_Weights") - changing from 0 to 1

oOptions.Value("Vector_Resolution")  - altering to various values

Neither seem to make any difference.

I'm essentially:

  1. looping through all referenced files
  2. opening their corresponding drawing (using False for OpenVisible boolean)
  3. looping each sheet and updating it (i.e. For each sheet > sheet.Activate > sheet.Update)
  4. Setting PDF options
  5. Saving as PDF with options

Here is a snippet of the important part:

	oFullFileName = oDrawDoc.FullFileName
	oFileName = IO.Path.GetFileNameWithoutExtension(oFullFileName) 
	oPDFAddIn = ThisApplication.ApplicationAddIns.ItemById("{0AC6FD96-2F4D-42CE-8BE0-8AEA580399E4}")
	oContext = ThisApplication.TransientObjects.CreateTranslationContext
	oContext.Type = IOMechanismEnum.kFileBrowseIOMechanism
	oOptions = ThisApplication.TransientObjects.CreateNameValueMap
	oDataMedium = ThisApplication.TransientObjects.CreateDataMedium

	oOptions.Value("All_Color_AS_Black") = 0
	oOptions.Value("Remove_Line_Weights") = 0
	oOptions.Value("Vector_Resolution") = 400
	oOptions.Value("Sheet_Range") = Inventor.PrintRangeEnum.kPrintAllSheets

	Dim oFolder As String = ThisDoc.Path & "\PDF"

	'Check for the PDF folder and create it if it does not exist
	If Not System.IO.Directory.Exists(oFolder) Then
	    System.IO.Directory.CreateDirectory(oFolder)
	End If

	 'Set the PDF target file name
	oDataMedium.FileName = oFolder & "\" & oFileName & ".pdf"

	'Publish document
	oPDFAddIn.SaveCopyAs(oDrawDoc, oContext, oOptions, oDataMedium)

 Has anyone else experienced this? Any suggestions on how to fix?

I'm running Inventor 2018 with all latest updates.

0 Likes
671 Views
5 Replies
Replies (5)
Message 2 of 6

HermJan.Otterman
Advisor
Advisor

What if you make the PDF by hand? (without the code)

If this answers your question then please select "Accept as Solution"
Kudo's are also appreciated Smiley Wink

Succes on your project, and have a nice day

Herm Jan


0 Likes
Message 3 of 6

Anonymous
Not applicable

No problem when manually using the save as function.

0 Likes
Message 4 of 6

HermJan.Otterman
Advisor
Advisor

not shure now, but in the past we installed somtimes a free pdf creator like dopdf,

that helped for some problems, not shure if it will help you

If this answers your question then please select "Accept as Solution"
Kudo's are also appreciated Smiley Wink

Succes on your project, and have a nice day

Herm Jan


0 Likes
Message 5 of 6

Anonymous
Not applicable

I'm doing a few other things in the code like adding custom notes to each drawing so I really need the iLogic solution

0 Likes
Message 6 of 6

cshunt
Enthusiast
Enthusiast

It doesn't look like your code is any different from what I use. Are your views "rasterized"??

I did set a reference to the acrobat object, the last part of the code remove the layers view from the pdf file. It is annoying to turn it off in pdf properties.

I run this with VBA in lieu of ilogic but it reads the same.

 

You can get more pdf options by using pdfdistiller and acrobat. There are some fonts that get broke with the savecopyas()

 

Sub pdfprint(PrintLoc0 )


Dim oPDFAddin As TranslatorAddIn: Set oPDFAddin = ThisApplication.ApplicationAddIns.ItemById _
("{0AC6FD96-2F4D-42CE-8BE0-8AEA580399E4}")
'Dim oDocument As DrawingDocument: Set oDocument = ThisApplication.ActiveDocument
Dim oContext: Set oContext = ThisApplication.TransientObjects.CreateTranslationContext
oContext.Type = IOMechanismEnum.kFileBrowseIOMechanism
Dim oOptions: Set oOptions = ThisApplication.TransientObjects.CreateNameValueMap
Dim oDataMedium: Set oDataMedium = ThisApplication.TransientObjects.CreateDataMedium
'If oPDFAddin.HasSaveCopyAsOptions(oDocument, oContext, oOptions, oDataMedium) Then
    oOptions.Value("All_Color_AS_Black") = 0
    oOptions.Value("Remove_Line_Weights") = 0
    oOptions.Value("Vector_Resolution") = 400
    oOptions.Value("Sheet_Range") = Inventor.PrintRangeEnum.kPrintAllSheets
    'oOptions.Value("Custom_Begin_Sheet") = sSheetNumber
    'oOptions.Value("Custom_End_Sheet") = sSheetNumber
'End If
'Call oPDFAddin.SaveCopyAs(PrintLoc0 & ".pdf")
oDataMedium.fileName = PrintLoc0 & ".pdf"
Call oPDFAddin.SaveCopyAs(oDocument, oContext, oOptions, oDataMedium)
''Call oDocument.File.
'Call oDocument.SaveAs(PrintLoc0 & ".pdf", True)
Set oPDFAddin = Nothing

        Dim PDF As CAcroPDDoc: Set PDF = CreateObject("AcroExch.PDDoc") 'change the pdf initial view, possibly add some data to the pdf acropdf
        Dim pth As String: pth = PrintLoc0 & ".pdf"
        
            If PDF.Open(pth) = -1 Then
                Call PDF.SetPageMode(1) ' needed to remove layers info after export
                Call PDF.Save(PDSaveCollectGarbage, pth)
            End If
            
        PDF.Close

End Sub
0 Likes