【发布时间】:2019-03-05 18:22:42
【问题描述】:
与此问题类似,但解决方案不起作用。 Adobe Acrobat Reader doesn't print my drawing on a PDF
我使用Boox Max Carta 来编写和注释 pdf 作品。 注释从电子阅读器中导出为类别连接线的pdf注释(cmets)。
当我去打印时,如果我选择文档和标记 - 我什么也得不到。
如果我选择summary cmets,那么我会得到每个注释的数字,但没有涂鸦。
打印带注释的 pdf 需要做什么?
有没有办法将其展平成图像或其他东西?
解决方案 - 感谢 @mkl 找到根本原因
使用 Python PyMuPdf 库循环浏览页面和注释,为每个页面添加一个标志。
""" Recipies used
https://pymupdf.readthedocs.io/en/latest/faq/#how-to-search-for-and-mark-text
https://pymupdf.readthedocs.io/en/latest/faq/#how-to-add-and-modify-annotations
"""
import sys
import fitz
fname = sys.argv[1] # filename
doc = fitz.open(fname)
updated_annot_count = 0;
for page in doc:
current_annot = page.firstAnnot; # scan through the pages
while current_annot:
current_annot.setFlags(current_annot.flags|fitz.ANNOT_XF_Print)
current_annot = current_annot.next # Follow linked list
updated_annot_count = updated_annot_count+1
if doc:
doc.save("printable-" + doc.name)
The Pdf renders fine on the computer screen in both Chrome and Adobe Acrobat (2017)
【问题讨论】:
-
如果 Adobe Acrobat 无法正确加载它们,这通常表明无论导出 PDF 都有破坏文档的错误,您可能希望使用 Onyx 解决这个问题.你检查是否有固定固件?
-
Acrobat 确实可以正确加载它们(请参阅示例文件)。我只是无法打印连接线
-
我看到一堆乱七八糟的盒子,所以我认为您没有正确使用“正确”这个词。如果应该有更多内容,那么文档就会损坏,因为 Acrobat 确实是呈现 PDF 文档的黄金标准。如果其中有 Acrobat 无法呈现的内容,则说明该文档不符合 PDF 规范。
-
Google Chrome 和 Acrobat 可以在我的 PC 上完美呈现它们。我已经编辑了原始问题,并举例说明了它们是如何为我呈现的
-
这已经成为一个更好的解释。我还建议删除那个“虚拟文件”图片,因为重要的是你遇到了什么,以及它的属性描述。