Is there a website. It has an indoor section with orders. There are quite a lot of different documents with simple formatting (agreement) and complex (various forms and shapes). The requirement: to give the site visitors the completed documents to PDF.
Requirements: free library of PHP to re-compile PHP there is no possibility
I found 2 solutions:
- Simple documents in html to make and surpass to PDF with mpdf
- Complex shapes to lay out in OpenOffice, exportnet to PDF, generate FDF and glue PDF and FDF using pdftk
With the first no problem. But with the second option more difficult.
First made in the forehead: in OpenOffice spaced document in the field hammered the default values for the test, exportno to PDF. Open the result: the English letters are visible, and instead of Russian — Arabica. But! If you click in a field, then there is normal Russian text.
The network found that it is necessary to embed the fonts. And it is desirable that they were in the format of OTF and Unicode. Found, filled out, when you export set the flag "embed fonts". The result is the same as in the first embodiment.
Began to search further. Written to use for marking only Acrobat Pro. Found this program. Spaced. Drove test data. And for the test directly from an Acrobat generated the FDF file. Now I wonder:
- if you open the FDF in Adobe Reader, then he swears at security (say I agree) and then it opens the PDF and correctly inserts the data. But this is not enough, because the customer must pay ready non-editable PDF
- if you use pdftk to cross PDF and FDF from Acrobat, the resulting file field blank. But if you click it, will appear the data from the FDF. Almost what I need.
Also experimented with setting the visibility of fields and mode of "read-only" — nothing happened.
Anyone able to fill PDF forms in Russian using PHP?
PS: I have 2 options: a) complex forms to Severstal in HTML (but there are doubts that all mpdf digest) b) complex forms translated into intermediate format (TeX, SVG), and then to PDF (it's quite hard and long)