Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Make one PDF file of Python documentation

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.

like image 499
Fish Monitor Avatar asked Jul 22 '13 05:07

Fish Monitor


People also ask

How do I create an automated PDF in Python?

Create PDFs with Python Library – PDFKit You can run the command in the console to generate PDFs. To use the command-line in Python, JazzCore developed PDFKit – a wrapper for wkhtmltopdf utility. Once wkhtmltopdf and PDFKit are installed, the next step is to create a Python file to generate a PDF from a URL.


2 Answers

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.)

-- edit2 --

It seems sejda-console is not freely available anymore, only as commercial sejda-console-pro

But the current free version of PDFsam (v.4.2.12) allows for the same bookmarking options.

Both appear to have the same developer.

like image 98
blablatros Avatar answered Oct 06 '22 21:10

blablatros


apt-get install poppler
pdfunite *.pdf all.pdf
like image 23
Anonymous Avatar answered Oct 06 '22 19:10

Anonymous