我可以使用Python在PDF文档中填写表单字段吗?

发布于 2025-02-14 01:30:49 字数 284 浏览 3 评论 0原文

我有一个表单字段填充的PDF,我想使用Python脚本填充,我无法使用JavaScript,这似乎是首选的解决方案。这是可以通过Python脚本来完成的吗?捕获是,我无法安装任何库,例如pypdf2,fillpdf或fdfgen,例如答案。这仍然可以吗?我可以自制类似的解决方案吗?

可以将字段仔细检查,并假设字段的alt文本是其名称,我也有这些字段,尽管似乎至少有1个字段未命名。

理想情况下,我想用可以通过编程方式生成的变量填充多个特定字段,然后将PDF保存为新文件。

I have a form field fillable PDF that I'd like to fill using a python script, I can't use JavaScript which seems to be the preferred solution. Is this something that can be done through a python script? The catch is that I can't install any libraries like PyPDF2, fillpdf, or fdfgen like in this answer. Is this still possible? Can I homebrew a similar solution?

The fields can be tabbed through and assuming the alt text of a field is its name, I have those as well, though at least 1 field appears to be unnamed.

Ideally I'd like to fill multiple specific fields with variables that I can programmatically generate and then save the PDF as a new file.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文