Inventor Pro 2021 PDF export size optimization

Inventor Pro 2021 PDF export size optimization

BrandonBG
Collaborator Collaborator
1,768 Views
5 Replies
Message 1 of 6

Inventor Pro 2021 PDF export size optimization

BrandonBG
Collaborator
Collaborator

Does Inventor Pro 2021 export PDF drawings in a different way compared to 2020?

 

I'm working with a large 43 sheet drawing document (this is fairly typical for me). In 2020, the exported PDFs are slightly more than 4 MB file sizes.

 

Revising the same drawing document in 2021 with no added sheets or views gives me an exported PDF size of 74 MB. Fortunately, I have a full version of Adobe Acrobat and can optimize PDFs outside of Inventor.

 

Here's the rule I'm using the export PDFs. Thanks to whomever I stole this from.

Dim oPDFAddIn As TranslatorAddIn
oPDFAddIn = ThisApplication.ApplicationAddIns.ItemById("{0AC6FD96-2F4D-42CE-8BE0-8AEA580399E4}")

Dim oDocument As Document
oDocument = ThisApplication.ActiveDocument

oFileName = ThisDoc.FileName(False)
oContext = ThisApplication.TransientObjects.CreateTranslationContext
oContext.Type = IOMechanismEnum.kFileBrowseIOMechanism
oOptions = ThisApplication.TransientObjects.CreateNameValueMap
oDataMedium = ThisApplication.TransientObjects.CreateDataMedium

Dim oDrawing as DrawingDocument
oDrawing = ThisDrawing.Document

Dim iBeginSheet As Integer

If oDrawing.Sheets.Item(1).IsModelSpaceSheet = True Then
	iBeginSheet = 2
	Else iBeginSheet = 1
End If

Dim iEndSheet As Integer
iEndSheet = oDocument.Sheets.Count


	oOptions.Value("All_Color_AS_Black") = 0
	oOptions.Value("Remove_Line_Weights") = 0
	oOptions.Value("Vector_Resolution") = 4800
	oOptions.Value("Sheet_Range") = Inventor.PrintRangeEnum.kPrintSheetRange
	oOptions.Value("Custom_Begin_Sheet") = iBeginSheet
	oOptions.Value("Custom_End_Sheet") = iEndSheet

oDataMedium.FileName = ThisDoc.Path() & "\" & oFileName & ".pdf"

oPDFAddIn.SaveCopyAs(oDocument, oContext, oOptions, oDataMedium)

ThisDoc.Launch(oDataMedium.FileName)

 

Brandon

0 Likes
Accepted solutions (1)
1,769 Views
5 Replies
Replies (5)
Message 2 of 6

johnsonshiue
Community Manager
Community Manager

Hi! We are investigating an issue regarding the PDF export size on 2021. I will work with the project team to understand it better.

Many thanks!



Johnson Shiue (johnson.shiue@autodesk.com)
Software Test Engineer
Message 3 of 6

BrandonBG
Collaborator
Collaborator

Thanks @johnsonshiue.

 

Brandon

0 Likes
Message 4 of 6

BrandonBG
Collaborator
Collaborator

Here's another example. Revisions 1 and 2 were exported by 2020. Revision 3 by 2021.

 

BrandonBG_0-1587240477132.png

 

Brandon

 

0 Likes
Message 5 of 6

rui_wang
Autodesk
Autodesk
Accepted solution

@BrandonBG

 

Thanks for your information.

 

In Inventor 2021 release, engineer team has fixed the issue that the vector resolution did not work correctly on previous releases, that's why the pdf file would become larger with same export options. So this behavior is expected as you have set the vector resolution to 4800 in the VBA code. If you want to reduce the file size, please set the option to 400 and then try again. Thanks a lot. 

 

oOptions.Value("Vector_Resolution") = 4800 '400

Thanks,

-Rui

Message 6 of 6

BrandonBG
Collaborator
Collaborator

Thanks @rui_wang. I appreciate the information.

 

Brandon