制作一个Python文件的PDF文件 [英] Make one PDF file of Python documentation

查看:122
本文介绍了制作一个Python文件的PDF文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Python官方网站提供PDF文档下载,但是它们分为几章。我下载了源代码并构建了PDF文档,它们也是单独的PDF。

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.

如何从源代码中的Makefile中构建一个PDF文件?我认为这样会更方便。

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

如果将单独的PDF连接起来不会遗漏目录(书签),那么这也是可以接受的。我从Imagemagick, pdftk pdfunite poppler-utils ,它们在连接后都会丢失书签。

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.

推荐答案

如果你已经有了PDF,没有必要重新创建它们。而是使用 PDF拆分&合并 PDFArchitect

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

- - 编辑---

--- edit ---

由于上述解决方案只能部分工作,我googled了一下,发现 sejda 。您可以下载最新版本 here

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.

尝试 sejda-console -h merge 对于其他选项(即使用PDF指定dir,而不是单个文件等)

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

这篇关于制作一个Python文件的PDF文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆