使用 PDFTK(或 php/javabridge)填充 PDF 表单,忽略某些 unicode 字符
我们想要实现的目标:
使用 drupal webform 提交数据作为源来填写 PDF 表单并将其提供给用户,并进行扁平化以供打印。我们正在尝试将其部署在 Drupal 6 上,然后再部署在 Drupal 7 上。站点是部署在 CentOS VPS 上的大型 D6 站点。我们正在将其转移到 D7。
链接:
我们的问题:
无论我们如何尝试,都无法将某些 Unicode(utf-8) 字符插入到 PDF 中。
具体来说,这些不起作用:č、đ、ć
这些工作:š、ž
注意:这必须有效,因为这些字符在斯洛文尼亚人的名字和姓氏中很常见,并且此 pdf 是斯洛文尼亚合同的打印输出。
我们尝试过的:
我们首先使用我们的系统管理员从源代码构建的 PDFTK。我们尝试了 1.41 和 1.41。然后他找到了两个版本的软件包,我们对它们都进行了测试。没有一个起作用。然后,我们分析了该模块,并使用相同的命令行函数和精简示例。它产生了相同的结果。我们尝试在 Mac 上生成从 DOC 转换而来的 PDF,而不是使用 Adobe Acrobat Pro 添加的字段。我们尝试在 Linux Mint 上使用 LibreOffice 创建 PDF。两者产生相同的结果。此问题已在我们的 sysadmin 的 CentOS vps、CentOS virtualbox 安装和 ubuntu 10.04 devbox 以及 2 个 D6 vanilla 安装、1 个 D7 vanilla 安装和生产 D6 安装上重复出现。 我们还尝试了 fillpdf 模块提供的第二个选项:java/tomcat 桥(更多信息)。在 ubuntu 10.04 devbox 上尝试过,但也不起作用。我们还尝试了提供的软件即服务 PDFTK 服务 FillPDF 服务,它也产生了相同的结果。
有什么想法可能是错的吗?有什么想法如何完成此任务(即使使用其他系统、服务、自定义代码等)?
Possibly related question 1, Related question 2
What We're trying to accomplish:
Use drupal webform submition data as a source to fill a PDF form and serve it to the user, flattened for printing. We're trying to deploy this on Drupal 6 and later on Drupal 7. Site is a large D6 site deployed on a CentOS VPS. We're in the process of moving it to D7.
Links:
Our problem:
No matter what we try we can not get certain Unicode(utf-8) chars to be inserted into the PDF.
Specifically these do not work: č, đ, ć
These work: š, ž
NOTE: This has to work as these chars are common in names and surnames of Slovenians, and this pdf is a printout for a contract in Slovenia.
What we tried:
We first used PDFTK that our sysadmin built from source. We tried 1.41 and 1.41. He than found a package of both version and we tested them both. None worked. We than analyzed the module and used the same command line function with a striped down example. It produced the same result. We tried PDF generated on a Mac that was converted from a DOC, than fields added with Adobe Acrobat Pro. Than we tried a PDF created with LibreOffice on Linux Mint. Both produced the same results. This problem has been replicated on CentOS vps, CentOS virtualbox install of our sysadmin and a ubuntu 10.04 devbox and across 2 D6 vanilla installs, 1 D7 vanilla install and on the production D6 install.
We also tried the second option given by the fillpdf module: java/tomcat bridge (More here). This was tried on the ubuntu 10.04 devbox and it also did not work. We also tried the provided software-as-a-service PDFTK service FillPDF service and it also produced the same result.
Any ideas what could be wrong? Any ideas how to get this done (even with the use of other system, services, custom code etc.)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试使用:
http://sourceforge.net/projects/pdfformfiller2/files/。
要安装,请执行以下操作:
Fillpdf:
Webform:
Webform tokens:
PDF form filler 2:
您还需要在服务器上安装此 java 包:
Try using:
http://sourceforge.net/projects/pdfformfiller2/files/.
For instalation do this:
Fillpdf:
Webform:
Webform tokens:
PDF form filler 2:
You will also need this java packages on server: