Select to view content in your preferred language

exportToPDF producing wrong colors and symbology

1481
5
Jump to solution
04-15-2020 11:10 AM
BrettFrahm
Frequent Contributor

Using both the mapSeries.exportToPDF() and the layout.exportToPDF(), I am getting different colors than if I had exported the layouts manually in ArcGIS Pro. On layout graphics the export is adding borders even though in the project those borders are set to be no color. I've tried adjusting the various parameters in the exportToPDF() tool with no success.

Left is manually exported, Right is exported through arcpy.

prj = arcpy.mp.ArcGISProject(InputProject)
layouts = prj.listLayouts()
for layout in layouts:
    print(layout.name)
    OutputExport = os.path.join(OutputFolder, layout.name)
    if not layout.mapSeries is None:
        ms = layout.mapSeries
        if ms.enabled:
            pageNumber = ms.pageCount
            print(pageNumber)
            ms.exportToPDF(out_pdf=OutputExport, page_range_type='ALL', multiple_files='PDF_SINGLE_FILE', resolution=900,
                          image_quality='BEST', compress_vector_graphics=True, image_compression='ADAPTIVE',
                          embed_fonts=True, layers_attributes="LAYERS_ONLY", georef_info=True,
                          clip_to_elements=False, show_selection_symbology=False,
                          output_as_image=False, embed_color_profile=True)

Let me know if anyone has any ideas.

Jeff Barrette ‌

Amanda Huber

0 Kudos
1 Solution

Accepted Solutions
BrettFrahm
Frequent Contributor

Hey Jeff,

Thanks for reaching out. I had difficulties packaging my project, but I did end up figuring out the issue. The layouts were set to be CMYK in the Color Management settings, so switching them back to RGB fixed my issue.

View solution in original post

0 Kudos
5 Replies
JeffBarrette
Esri Regular Contributor

Hi Brett!  Would it be possible for you to send me a small PPKX?

Jeff

0 Kudos
BrettFrahm
Frequent Contributor

Hey Jeff,

Thanks for reaching out. I had difficulties packaging my project, but I did end up figuring out the issue. The layouts were set to be CMYK in the Color Management settings, so switching them back to RGB fixed my issue.

0 Kudos
JeffBarrette
Esri Regular Contributor

Hi Brett, its always great when you answer your own question but ...

We do have a fix going into Pro 2.6 that does address color management in our APIs.  Switching to RGB is not always a solution.

Curious, did your outlines go away when you changed to RGB?  That doesn't make sense and I can NOT reproduce that scenario.

Also - are you running your scripts stand-alone?  Do you see a difference if you perform the same export using CURRENT?

Thanks

Jeff

0 Kudos
BrettFrahm
Frequent Contributor

Hey Jeff,

Did a little testing at your request.

  • I was unable to reproduce the original issue where the manual export differed from the Python export when I switched the layout back to CMYK. With the original issue I was running python stand-alone.
  • I'm able to reproduce the outline issue with any CMYK layout if the outline color is set to "no color", but the outline width is 1 pt. Happens with manual export, python stand-alone, and python window in pro using 'current' project.

As a heads up, I will be participating in the 2.6 holistic testing, so you can send some tests my way during that for color management if you would like.

0 Kudos
JeffBarrette
Esri Regular Contributor

Thanks Brett!  I can reproduce with a rectangle element.  I had tried picture (I thought your title element was a picture).  For me it doesn't matter if CM is enabled or not or even color model.  I always get the outline.  We will look into this for 2.6.  Jeff

0 Kudos