Select to view content in your preferred language

Output as Image option INCREASES file size in arcpy script.

2682
2
12-18-2024 11:58 AM
Labels (1)
RandyMcGregor_BMcD
Frequent Contributor
lyt.exportToPDF(os.path.join(param1,outname),"ALL","",multiple_files,resolution=param5,output_as_image=True)

I have a tool that exports selected layouts. I thought I would add an option to select 'Output as Image' which greatly reduces output file size. It has the opposite effect, though. It vastly increases file size - almost 10 times. From 1.9 to about 13 mb. I exported using layout->share, selected output as image and the output was reduced in size as expected. Is there anything about using the setting in a script tool I should know?

The above script line works fine and the variables (param1, param5, etc...) are working as desired. Adding 'output_as_image=True' just has the opposite effect of what I hoped. 'output_as_image=False' works as I would expect .

Thank you for any information you may be able to provide.

Randy McGregor

0 Kudos
2 Replies
GKmieliauskas
Esri Regular Contributor

Hi,

Have you seen that ideas thread? There are helpful settings here.  Author recommends output_as_image set to False and set other parameters for smaller size.

0 Kudos
RandyMcGregor_BMcD
Frequent Contributor

Thank you. That was interesting. I am finding it works now, and I'm thinking perhaps when I was developing the code, it didn't 'stick' at first or with multiple runs and reruns of the tool, the system got confused. This has happened before. Anyway, it regularly works as desired now. Thanks for your input.

0 Kudos