I currently use this code to add Order# to an existing PDF
However, the modified PDF is 15 times larger in size than the original PDF (original 60kb, modified 800kb)
How do I change the save properties in the <code style="margin: **** padding: 1px 5px; border: **** font-size: 13px; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; white-space: pre-wrap; background-color: rgb(239, 240, 241);">Call myDocument.Save(1, strPath & strFileName)</code> so that it doesn't increase the original file size?
Code:
[COLOR=#101094][FONT=Consolas]Function[/FONT][/COLOR][COLOR=#303336][FONT=Consolas] PDF_Numbering[/FONT][/COLOR][COLOR=#303336][FONT=Consolas]([/FONT][/COLOR][COLOR=#303336][FONT=Consolas]order [/FONT][/COLOR][COLOR=#101094][FONT=Consolas]As[/FONT][/COLOR][COLOR=#303336][FONT=Consolas] [/FONT][/COLOR][COLOR=#101094][FONT=Consolas]String[/FONT][/COLOR][COLOR=#303336][FONT=Consolas])[/FONT][/COLOR]
<code style="margin: **** padding: **** border: **** font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; white-space: inherit;">[COLOR=#303336]
[/COLOR][COLOR=#101094]Dim[/COLOR][COLOR=#303336] acroApp [/COLOR][COLOR=#101094]As[/COLOR][COLOR=#303336] Acrobat[/COLOR][COLOR=#303336].[/COLOR][COLOR=#303336]acroApp
[/COLOR][COLOR=#101094]Dim[/COLOR][COLOR=#303336] myDocument [/COLOR][COLOR=#101094]As[/COLOR][COLOR=#303336] Acrobat[/COLOR][COLOR=#303336].[/COLOR][COLOR=#303336]AcroPDDoc
[/COLOR][COLOR=#101094]Dim[/COLOR][COLOR=#303336] jso [/COLOR][COLOR=#101094]As[/COLOR][COLOR=#303336] [/COLOR][COLOR=#101094]Object[/COLOR][COLOR=#303336]
[/COLOR][COLOR=#101094]Dim[/COLOR][COLOR=#303336] strPath [/COLOR][COLOR=#101094]As[/COLOR][COLOR=#303336] [/COLOR][COLOR=#101094]String[/COLOR][COLOR=#303336]
[/COLOR][COLOR=#101094]Dim[/COLOR][COLOR=#303336] strFileName [/COLOR][COLOR=#101094]As[/COLOR][COLOR=#303336] [/COLOR][COLOR=#101094]String[/COLOR][COLOR=#303336]
[/COLOR][COLOR=#101094]Dim[/COLOR][COLOR=#303336] intPages [/COLOR][COLOR=#101094]As[/COLOR][COLOR=#303336] [/COLOR][COLOR=#101094]Integer[/COLOR][COLOR=#303336]
[/COLOR][COLOR=#101094]Dim[/COLOR][COLOR=#303336] i [/COLOR][COLOR=#101094]As[/COLOR][COLOR=#303336] [/COLOR][COLOR=#101094]Integer[/COLOR][COLOR=#303336]
[/COLOR][COLOR=#101094]Set[/COLOR][COLOR=#303336] acroApp [/COLOR][COLOR=#303336]=[/COLOR][COLOR=#303336] CreateObject[/COLOR][COLOR=#303336]([/COLOR][COLOR=#7D2727]"AcroExch.App"[/COLOR][COLOR=#303336])[/COLOR][COLOR=#303336]
[/COLOR][COLOR=#101094]Set[/COLOR][COLOR=#303336] myDocument [/COLOR][COLOR=#303336]=[/COLOR][COLOR=#303336] CreateObject[/COLOR][COLOR=#303336]([/COLOR][COLOR=#7D2727]"AcroExch.PDDOc"[/COLOR][COLOR=#303336])[/COLOR][COLOR=#303336]
strPath [/COLOR][COLOR=#303336]=[/COLOR][COLOR=#303336] [/COLOR][COLOR=#7D2727]"C:\Users\Daniel\Downloads\"[/COLOR][COLOR=#303336]
strFileName [/COLOR][COLOR=#303336]=[/COLOR][COLOR=#303336] order [/COLOR][COLOR=#303336]&[/COLOR][COLOR=#303336] [/COLOR][COLOR=#7D2727]".pdf"[/COLOR][COLOR=#303336]
[/COLOR][COLOR=#858C93]'Open file and load JSObject[/COLOR][COLOR=#303336]
[/COLOR][COLOR=#101094]Set[/COLOR][COLOR=#303336] myDocument [/COLOR][COLOR=#303336]=[/COLOR][COLOR=#303336] CreateObject[/COLOR][COLOR=#303336]([/COLOR][COLOR=#7D2727]"AcroExch.PDDOc"[/COLOR][COLOR=#303336])[/COLOR][COLOR=#303336]
myDocument[/COLOR][COLOR=#303336].[/COLOR][COLOR=#303336]Open [/COLOR][COLOR=#303336]([/COLOR][COLOR=#303336]strPath [/COLOR][COLOR=#303336]&[/COLOR][COLOR=#303336] strFileName[/COLOR][COLOR=#303336])[/COLOR][COLOR=#303336]
[/COLOR][COLOR=#101094]Set[/COLOR][COLOR=#303336] jso [/COLOR][COLOR=#303336]=[/COLOR][COLOR=#303336] myDocument[/COLOR][COLOR=#303336].[/COLOR][COLOR=#303336]GetJSObject
[/COLOR][COLOR=#858C93]' get number of pages[/COLOR][COLOR=#303336]
intPages [/COLOR][COLOR=#303336]=[/COLOR][COLOR=#303336] myDocument[/COLOR][COLOR=#303336].[/COLOR][COLOR=#303336]GetNumPages
[/COLOR][COLOR=#858C93]'Write page number[/COLOR][COLOR=#303336]
jso[/COLOR][COLOR=#303336].[/COLOR][COLOR=#303336]addWatermarkFromText _
cText[/COLOR][COLOR=#303336]:=[/COLOR][COLOR=#303336]order [/COLOR][COLOR=#303336]&[/COLOR][COLOR=#303336] [/COLOR][COLOR=#7D2727]" "[/COLOR][COLOR=#303336],[/COLOR][COLOR=#303336] _
nFontSize[/COLOR][COLOR=#303336]:=[/COLOR][COLOR=#7D2727]14[/COLOR][COLOR=#303336],[/COLOR][COLOR=#303336] _
nTextAlign[/COLOR][COLOR=#303336]:=[/COLOR][COLOR=#7D2727]1[/COLOR][COLOR=#303336],[/COLOR][COLOR=#303336] _
nHorizAlign[/COLOR][COLOR=#303336]:=[/COLOR][COLOR=#7D2727]2[/COLOR][COLOR=#303336],[/COLOR][COLOR=#303336] _
nVertAlign[/COLOR][COLOR=#303336]:=[/COLOR][COLOR=#7D2727]1[/COLOR][COLOR=#303336],[/COLOR][COLOR=#303336] _
nVertValue[/COLOR][COLOR=#303336]:=-[/COLOR][COLOR=#7D2727]30[/COLOR][COLOR=#303336],[/COLOR][COLOR=#303336] _
[/COLOR][COLOR=#858C93]'Save document[/COLOR][COLOR=#303336]
[/COLOR][COLOR=#101094]Call[/COLOR][COLOR=#303336] myDocument[/COLOR][COLOR=#303336].[/COLOR][COLOR=#303336]Save[/COLOR][COLOR=#303336]([/COLOR][COLOR=#7D2727]1[/COLOR][COLOR=#303336],[/COLOR][COLOR=#303336] strPath [/COLOR][COLOR=#303336]&[/COLOR][COLOR=#303336] strFileName[/COLOR][COLOR=#303336])[/COLOR][COLOR=#303336]
[/COLOR][COLOR=#858C93]'Clean up[/COLOR][COLOR=#303336]
[/COLOR][COLOR=#101094]Set[/COLOR][COLOR=#303336] jso [/COLOR][COLOR=#303336]=[/COLOR][COLOR=#303336] [/COLOR][COLOR=#7D2727]Nothing[/COLOR][COLOR=#303336]
[/COLOR][COLOR=#101094]Call[/COLOR][COLOR=#303336] acroApp[/COLOR][COLOR=#303336].[/COLOR][COLOR=#303336]CloseAllDocs
[/COLOR][COLOR=#101094]Set[/COLOR][COLOR=#303336] myDocument [/COLOR][COLOR=#303336]=[/COLOR][COLOR=#303336] [/COLOR][COLOR=#7D2727]Nothing[/COLOR][COLOR=#303336]
[/COLOR][COLOR=#101094]Call[/COLOR][COLOR=#303336] acroApp[/COLOR][COLOR=#303336].[/COLOR][COLOR=#101094]Exit[/COLOR][COLOR=#303336]
[/COLOR][COLOR=#101094]Set[/COLOR][COLOR=#303336] acroApp [/COLOR][COLOR=#303336]=[/COLOR][COLOR=#303336] [/COLOR][COLOR=#7D2727]Nothing[/COLOR][COLOR=#303336]
[/COLOR]</code>[COLOR=#101094][FONT=Consolas]End[/FONT][/COLOR][COLOR=#303336][FONT=Consolas] [/FONT][/COLOR][COLOR=#101094][FONT=Consolas]Function[/FONT][/COLOR]
However, the modified PDF is 15 times larger in size than the original PDF (original 60kb, modified 800kb)
How do I change the save properties in the <code style="margin: **** padding: 1px 5px; border: **** font-size: 13px; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; white-space: pre-wrap; background-color: rgb(239, 240, 241);">Call myDocument.Save(1, strPath & strFileName)</code> so that it doesn't increase the original file size?