I'm trying to export a report to PDF via report.exportToPDF (as described into help section). The script works fine but the created PDF's size is too big (~50 Mb) because all the pages of the report are rasterized.. Comparing with the file created via UI (ArcGIS Pro -> Report -> Share as PDF) which is about ~600 kb.. cause this file is in "vector" normal PDF format (except for small pictures with logo).
So, the question: is it possible to export report into PDF via arcpy the same way like from ArcGIS Pro UI?
I'm using latest version of ArcGIS Pro 2.3.2. and default python 3 environment.
Example of the code:
import arcpy, datetime, os
# Set parameters for the main report & create PDF
aprx = arcpy.mp.ArcGISProject(r"c:\NGM_GIS\NG_Projects_all\NG_Projects_all.aprx")
report = aprx.listReports("TenementExtract Report TEST A3")
outPDF_report = r"c:\NGM_GIS\NG_Projects_all\ReportTEST\NG Tenement Report A3.pdf"
if os.path.exists(outPDF_report): os.remove(outPDF_report)
print("PDF report is created!")
I've already tried to insert different parameters into report.exportToPDF e.g.
3) image_compression = "NONE"
- always receive the same result...
P.S. in contrast exportToPDF works perfect with Layouts.
yes, i've tried switch "embed_fonts" to false - nothing changed..
While it's not clear why this parameter can influence and also i would like to have final PDF with all the fonts embed.
BTW, attached are the 2 printscreens showing the properties for the 2 different PDFs. It's obvious that they've been produced by different applications but i can't see any other differences.. and as i mentioned above exportToPDF (python console...) works fine for the layouts.
Jeremy Wright , did you ever get an answer to this? I'm about to recommend that we use the ArcGIS Pro reporting function for one of our projects but this might be a deal breaker since we will be generating a large number of documents. I'd much rather find out now than after we have invested a lot of time on it. Thanks
That was a few versions ago with no report back.
If you have a test report, either try the tool
or through arcpy
or you could look back in time to see if it was addressed
plus previous versions