2

I am looking for a simple way to concatenate one geospatial pdf (with multiple layers in a single image) and regular pdf. I have tried tools such as pdfunite, pdftk and pdfconcat, without success. The result is always a regular pdf, losing the layers and geospatial references.

Does it exist a simple tool for merging/concatenate geospatial pdfs? Have anyone else solved this problem using another method?

1

Debenu PDF Tools Pro are able to insert pages with geo-enabled content into regular PDF files without loosing the georeference information. This is true for at least GeoPDF files produced with ArcGIS (there are GeoPDF conform to Adobe geospatial extension only, or to the broader TerraGo technology).

The Debenu tools come with a 14 day trial period. Btw they are an example of what you can do with their PDF SDK.

  • Adobe acrobat pro is also able to merge pdf and keep geospatial information (and layers). Neither acrobat nor debenu (I didn’t test it) are available for linux (and neither are free if that is important). We have temporarily solved the problem by simply not merging the pdfs, instead producing two separate pdfs. – steelmountain Dec 10 '15 at 14:40
0

I recently discovered pyPDF2 for this. As a quick example see below:

#!/usr/bin/env python
#coding=utf-8
import os

from PyPDF2 import PdfFileMerger, PdfFileReader

merger = PdfFileMerger()
pdfDir = "D:/temp"
os.chdir(pdfDir)

files = [f for f in os.listdir(pdfDir) if os.path.isfile(f)]
filenames = filter(lambda f: f.endswith(('.pdf','.PDF')), files)

for filename in filenames:
    merger.append(PdfFileReader(filename, 'rb'))

merger.write("merged-pdf-output.pdf")
merger.close()

This successfully retained the geospatial information of each pyQGIS (QGIS3) generated pdf in the combined pdf file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.