I created a python script toolbox a while back that will take individual .pdf in a folder and merge them into one .pdf. 2 years later I run the tool box and of course it doesn't work. I have attache a picture of the error I am getting.
<SPAN class="comment token"># Import Modules</SPAN>
<SPAN class="keyword token">import</SPAN> arcpy<SPAN class="punctuation token">,</SPAN> os<SPAN class="punctuation token">,</SPAN> glob
<SPAN class="comment token"># Folder where PDFs will be stored</SPAN>
pdfFolder <SPAN class="operator token">=</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>GetParameterAsText<SPAN class="punctuation token">(</SPAN><SPAN class="number token">0</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="comment token"># Folder where final merged PDF will be stored</SPAN>
pdfname <SPAN class="operator token">=</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>GetParameterAsText<SPAN class="punctuation token">(</SPAN><SPAN class="number token">1</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="comment token"># Name of the finale merged PDF</SPAN>
mergedpdf <SPAN class="operator token">=</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>GetParameterAsText<SPAN class="punctuation token">(</SPAN><SPAN class="number token">2</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="comment token"># Creates a list of the PDF file paths</SPAN>
pdflist <SPAN class="operator token">=</SPAN> glob<SPAN class="punctuation token">.</SPAN>glob<SPAN class="punctuation token">(</SPAN>pdfFolder <SPAN class="operator token">+</SPAN> os<SPAN class="punctuation token">.</SPAN>sep <SPAN class="operator token">+</SPAN> <SPAN class="string token">'*.pdf'</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="comment token"># Creates a file path for the final PDF document </SPAN>
finalpdf <SPAN class="operator token">=</SPAN> pdfname <SPAN class="operator token">+</SPAN> os<SPAN class="punctuation token">.</SPAN>sep <SPAN class="operator token">+</SPAN> mergedpdf <SPAN class="operator token">+</SPAN> <SPAN class="string token">'.pdf'</SPAN>
pdfPath <SPAN class="operator token">=</SPAN> finalpdf
<SPAN class="keyword token">if</SPAN> os<SPAN class="punctuation token">.</SPAN>path<SPAN class="punctuation token">.</SPAN>exists<SPAN class="punctuation token">(</SPAN>pdfPath<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">:</SPAN>
os<SPAN class="punctuation token">.</SPAN>remove<SPAN class="punctuation token">(</SPAN>pdfPath<SPAN class="punctuation token">)</SPAN>
pdfdoc <SPAN class="operator token">=</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>mapping<SPAN class="punctuation token">.</SPAN>PDFDocumentCreate<SPAN class="punctuation token">(</SPAN>finalpdf<SPAN class="punctuation token">)</SPAN>
i <SPAN class="operator token">=</SPAN> <SPAN class="number token">0</SPAN>
<SPAN class="keyword token">for</SPAN> pdf <SPAN class="keyword token">in</SPAN> pdflist<SPAN class="punctuation token">:</SPAN>
pdfdoc<SPAN class="punctuation token">.</SPAN>appendPages<SPAN class="punctuation token">(</SPAN>pdflist<SPAN class="punctuation token">[</SPAN>i<SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">)</SPAN>
i<SPAN class="operator token">+=</SPAN><SPAN class="number token">1</SPAN>
<SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>