<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Merging PDFs without losing Layers (PDF Viewer) in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/merging-pdfs-without-losing-layers-pdf-viewer/m-p/1100931#M45885</link>
    <description>&lt;P&gt;Hi! In case anyone else needs it... Use the PDF merger&amp;nbsp; from the&amp;nbsp;&lt;STRONG&gt;Arcmap &lt;/STRONG&gt;arcpy. The drawback is that&amp;nbsp; for each PDF you have a list of layers, separately. I don't really like that.&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;def &lt;/SPAN&gt;&lt;SPAN&gt;merge_all&lt;/SPAN&gt;(dict_paths&lt;SPAN&gt;, &lt;/SPAN&gt;out_dir):&lt;BR /&gt;   &lt;SPAN&gt;for &lt;/SPAN&gt;empl&lt;SPAN&gt;, &lt;/SPAN&gt;pdfs &lt;SPAN&gt;in &lt;/SPAN&gt;dict_paths.items():&lt;BR /&gt;&lt;BR /&gt;      out_pdf = os.path.join(out_dir&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;"{0}.pdf"&lt;/SPAN&gt;.format(empl))&lt;BR /&gt;      &lt;SPAN&gt;# pdfDoc = arcpy.mp.PDFDocumentCreate(out_pdf) #this is for Pro&lt;BR /&gt;&lt;/SPAN&gt;      pdfDoc = arcpy.mapping.PDFDocumentCreate(out_pdf)&lt;BR /&gt;      &lt;SPAN&gt;for &lt;/SPAN&gt;pdf &lt;SPAN&gt;in &lt;/SPAN&gt;pdfs:&lt;BR /&gt;         pdfDoc.appendPages(pdf)&lt;BR /&gt;      pdfDoc.updateDocProperties(&lt;SPAN&gt;pdf_open_view&lt;/SPAN&gt;= &lt;SPAN&gt;"LAYERS"&lt;/SPAN&gt;)&lt;BR /&gt;      &lt;BR /&gt;      pdfDoc.saveAndClose()&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 22 Sep 2021 18:10:31 GMT</pubDate>
    <dc:creator>IoanaIstrateCiobanu</dc:creator>
    <dc:date>2021-09-22T18:10:31Z</dc:date>
    <item>
      <title>Merging PDFs without losing Layers (PDF Viewer)</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/merging-pdfs-without-losing-layers-pdf-viewer/m-p/592663#M26040</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anybody know how to merge two PDFs using Python while maintaning layers as shown on&amp;nbsp;the attached picture?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using arcpy for ArcGIS Pro to export an 'Overview' PDF and a 'Detailed Location' PDF.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Both PDFs contain the layers once they're opened on PDF viewer. However, when I merge both PDF 'lots' within a single 'Map Book' PDF using 'arcpy.PDFDocumentCreate' and '&amp;lt;pdfDoc&amp;gt;.appendPages', those layers are lost.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have also tried PdfFileMerger within PyPDF2 Library without success,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any thoughts?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks, Ana&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Dec 2019 14:46:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/merging-pdfs-without-losing-layers-pdf-viewer/m-p/592663#M26040</guid>
      <dc:creator>AnaVillaran</dc:creator>
      <dc:date>2019-12-05T14:46:42Z</dc:date>
    </item>
    <item>
      <title>Re: Merging PDFs without losing Layers (PDF Viewer)</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/merging-pdfs-without-losing-layers-pdf-viewer/m-p/1100931#M45885</link>
      <description>&lt;P&gt;Hi! In case anyone else needs it... Use the PDF merger&amp;nbsp; from the&amp;nbsp;&lt;STRONG&gt;Arcmap &lt;/STRONG&gt;arcpy. The drawback is that&amp;nbsp; for each PDF you have a list of layers, separately. I don't really like that.&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;def &lt;/SPAN&gt;&lt;SPAN&gt;merge_all&lt;/SPAN&gt;(dict_paths&lt;SPAN&gt;, &lt;/SPAN&gt;out_dir):&lt;BR /&gt;   &lt;SPAN&gt;for &lt;/SPAN&gt;empl&lt;SPAN&gt;, &lt;/SPAN&gt;pdfs &lt;SPAN&gt;in &lt;/SPAN&gt;dict_paths.items():&lt;BR /&gt;&lt;BR /&gt;      out_pdf = os.path.join(out_dir&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;"{0}.pdf"&lt;/SPAN&gt;.format(empl))&lt;BR /&gt;      &lt;SPAN&gt;# pdfDoc = arcpy.mp.PDFDocumentCreate(out_pdf) #this is for Pro&lt;BR /&gt;&lt;/SPAN&gt;      pdfDoc = arcpy.mapping.PDFDocumentCreate(out_pdf)&lt;BR /&gt;      &lt;SPAN&gt;for &lt;/SPAN&gt;pdf &lt;SPAN&gt;in &lt;/SPAN&gt;pdfs:&lt;BR /&gt;         pdfDoc.appendPages(pdf)&lt;BR /&gt;      pdfDoc.updateDocProperties(&lt;SPAN&gt;pdf_open_view&lt;/SPAN&gt;= &lt;SPAN&gt;"LAYERS"&lt;/SPAN&gt;)&lt;BR /&gt;      &lt;BR /&gt;      pdfDoc.saveAndClose()&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Sep 2021 18:10:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/merging-pdfs-without-losing-layers-pdf-viewer/m-p/1100931#M45885</guid>
      <dc:creator>IoanaIstrateCiobanu</dc:creator>
      <dc:date>2021-09-22T18:10:31Z</dc:date>
    </item>
  </channel>
</rss>

