Draw text on a loaded pdf file with Zend Framework -


I am trying to load an existing PDF file, and fill it with database information. In addition to loading the file and writing data on the page loaded, everything is working. It does not write text on the page loaded, if I add a new page to apply drawing to all pages, all the added pages are written, except for one loaded. Below is the code I am using:

  $ pdf = Zend_Pdf :: load ('.documents / agreements / _root / gegevens.pdf'); // Load PDF $ pdf- & gt; Pages = array_reverse ($ pdf- & gt; page); // reverse page $ pdf- & gt; Pages [] = new Zend_Pdf_Page (Zend_Pdf_Page :: SIZE_A4); // Add a page (A4) $ font = Zend_Pdf_Font :: fontWithName (Zend_Pdf_Font :: FONT_HELVETICA); // Set fonts foreach ($ pdf- & gt; pages as $ page) // Apply settings = Text on each page (total 2) {$ page- & gt; Set font ($ font, 36); $ Page- & gt; SetAlpha (0.25); $ Page- & gt; Draw Text ('LALALALALA', 62, 260, 'UTF-8'); } $ Pdf- & gt; Save ('. / Documents / Agreements / Gegevens _'. $ This- & gt; school_id. '.pdf'); // File Save  

I resolved the problem: I created a new PDF file separately Made settings Creating a PDF with the following settings (I use the Acrobat PDMKarkak Office COM Addin for the word) did the trick I think the code was working after all, the PDF itself was causing problems.

Select Save as PDF in Word Select 'Quick and Simple PDF' format

Change the settings in 'ADAB PDF Conversion Options':

Enabled -> Change Document Information
Enable -> Make PDF / A Compliant
Disable -> Create Bookmarks From
Disable -> Convert Comments

Note : Saving this file as a PDF is related to the word. Other office applications are not tested.


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -