Make one PDF file of Python documentation

2019-03-27 02:47发布

问题:

The Python official site offers PDF documentation downloads, but they are separated by chapters. I downloaded the source code and built the PDF documentation, which were separate PDFs also.

How can I build one PDF file from the Makefile in the source code? I think that would be more convenient to read.

If concatenating the separate PDFs won't leaves out the table of contents (bookmarks), it would be acceptable too. I tried convert from Imagemagick, pdftk and pdfunite from poppler-utils, they all lose the bookmarks after concatenation.

回答1:

If you already have PDFs, there is no need to re-create them. Instead, use something like PDF Split & Merge or PDFArchitect.

--- edit ---

Since the above mentioned solutions work only partially, I googled a bit and found sejda. You can download latest version here.

sejda-console merge -f PDFfile_1.pdf PDFfile_2.pdf -o PDFoutput.pdf

I tried it and it works as expected.

Try sejda-console -h merge for other options (i.e. specify dir with PDFs instead single files, etc.)



回答2:

apt-get install poppler
pdfunite *.pdf all.pdf