google-chrome - 使用 PDF 文件输入的 Chrome Headless print-to-pdf
问题描述
我正在尝试使用 Headless Chrome 从 pdf 文件重新打印 pdf 文件。
类似帖子:在 ubuntu 中使用无头 chrome 打印 PDF
我已经尝试了几种变体:
chrome --headless --disable-gpu --print-to-pdf=E:/Python/Working/foo_flat3.pdf file://E:/Python/Working/foo_flat2.pdf
chrome --headless --disable-gpu --print-to-pdf=E:/Python/Working/foo_flat3.pdf "E:/Python/Working/foo_flat2.pdf"
并且不会生成 PDF 文件。当我使用网页时,例如:
chrome --headless --disable-gpu --print-to-pdf=E:/Python/Working/foo_flat3.pdf https://www.google.com/
它按预期运行,并生成“foo_flat3.pdf”。
我为什么要这样做?我正在尝试利用 Chrome 解锁和展平 pdf 文件的能力,因为它是我找到的最快的选项。如果还有其他选择,我也会对这些感兴趣。
解决方案
推荐阅读
- c++ - 在 Qt 5.3 版中将 QString 转换为 QChar
- aws-lambda - Alexa 应用程序开发是否需要 Lambda?
- python - Python正则表达式库是否有最大匹配
- java - Kotlin 标准库中的 String 类是如何实现的?
- python - Python 如何进行主机名查找?
- python - 基于具有相同值对但在两个数据框中以不同顺序显示的两列合并熊猫数据框
- amazon-web-services - 我无法获取 ALB URL。地址为空
- snowflake-cloud-data-platform - 如何在不丢失或复制任何记录的情况下移动或更改管道
- javascript - 验证数组中的几个对象的干净方法是什么?
- google-cloud-platform - GCP Marketplace 基本映像