PHP Pdf creation - R&OS / Blog: Recent posts

font metrics files are invalid in versions prior to 0.11.8

Hi all,

please note that almost all font metrics (known as *.afm files) have some invalid entries for special chars in versions prior to 0.11.8

Please update those by using the following link:
http://sourceforge.net/code-snapshots/svn/p/pd/pdf-php/code/pdf-php-code-287-branches-0.11.7-php4.zip

Extract the font folder into your current ros pdf installation and also make sure you are using version 0.11.7c for PHP4... read more

Posted by Ole K 2014-04-03

advanced table gridlines in 0.12-rc11

Soon we are going to deploy another update which has several changes mostly related to ezTable

Also included are two important bugfixes

  • fixed bug #75 Alignment fixes for tables and images
  • fixed an old bug related to vertical lines in ezTable when page break occurs

Thanks to Emil Totev for the patch which provides advanced gridline support in ezTable.
All gridline options are available here... read more

Posted by Ole K 2013-12-04 Labels: gridlines alignment ezTable

The colorful R&OS pdf class

Since version 0.12-rc9 we have implemented two small features which allows the R&OS class to be more colorful.

  • ezTable supports shade color in headings by setting the "shadeHeadingCol"=>(r,g,b).
    More details in the readme file or on examples/table.php
  • callback function added which allows you to tint text, Example can be found in examples/background_color.php.

We also fixed some bugs related to font subsetting and optimized the PDF output a bit.... read more

Posted by Ole K 2013-12-01

0.12-rc8 AAR search and new fontPath property

Hello Folks,

It took me a while to figure out why adobe readers "fast find feature" could not search R&OS generated pdf documents until I noticed it must have something to do with the fileIdentifer.

The solution to solve the AAR search issue (know as bug #71) is damn easy...An Id is an id is an id.
So I changed the fileIdentifier property in Cpdf->__construct() to be unqiue..

This Issue has also been discussed on on stackoverflow.com... read more

Posted by Ole K 2013-11-26 Labels: 0.12-rc8 fontPath AAR search

0.13.0 More object oriented?!

Dear programmers,

Focusing on php version 5 our major goal for the R&OS pdf environment is to have it more object oriented allowing you to access and amend the library easily.

Thats why we are planing to rebuild the Cpdf.php file.
Starting with a skeleton of following classes:

  • Cpdf (main class to build up all additional class objects)
  • Cpdf_Page (page class)
  • Cpdf_Contents (base class for any content, like text or lines, rectangles..)
  • Cpdf_Writing (select font, write text, manage callbacks)
  • Cpdf_Appearance (used for graphical output, like line, rectangles, curves, ...)
  • Cpdf_Annotation (annotation, like text, links, freetext [, movies , sound, ...])
  • Cpdf_Callback (handles the callbacks used in any test passed thru Cpdf_Writing)
  • Cpdf_Font (handles the font program, ANSI or unicode)
  • Cpdf_Encryption (encryption for up to 128bit)
  • Cpdf_* (some small graphical elements, like borders and colors)... read more
Posted by Ole K 2013-09-23

version 0.12.1 is buggy

According to some discussion in forum (see https://sourceforge.net/p/pdf-php/discussion/147988/thread/be7143c6/?limit=25) it seems that the version 0.12.1 has several bugs for unicode fonts

So please make sure you have updated to version 0.12.2
This version will be the release candidate.

I highly appreciate to give me feedback
Thank you

Posted by Ole K 2013-09-08

Experimental version 0.12

I have published an experimental version which comes with the following changes:

  • optimized and simplified the methods for custom callbacks (checkTextDirective is no more)
  • improved performance (readme.php is 30% faster)
  • new property called $pdf->allowedTags, which is important for custom callbacks (see barcode.php,
    CezTableImage.php or CezDummy.php)
  • font subsetting completed
  • No more ttf2afm or ttf2ufm is required - Thank goes to Thanos Efraimidis (4real.gr) for TTF.php and
    TTFsubset.php... read more
Posted by Ole K 2013-07-16

Fonts the 2nd

In version 0.11.8 I finally implemented font subsets which can be used with the follow method

$pdf->selectFont(fontName, [,encoding] = '' [,fontSubset] = false)

It includes two additional php script which has be developed by Thanos Efraimidis (4real.gr
More info: http://www.4real.gr/technical-documents-ttf-subset.html

Its a first try to provide subsetting.
In a later step I am going to use TTF.php more extensive to get rid of the ttf2ufm and ttf2afm tool.... read more

Posted by Ole K 2013-07-09

All about Fonts - Unicode, Arabic support and FreeSerif

In version 0.11.6 unicode fonts are supported in R&OS pdf class.

To export ttf fonts into "*.ufm", please use the tool named "ttf2ufm" -http://code.google.com/p/ttf2ufm/

Major changes to the code are located in openFont, selectFont, o_font AND filterText method.
The following methods have been added

  • o_fontDescendentCID
  • o_fontGIDtoCIDMap
  • utf8toUtf16BE - thanks to Nicola Asuni
  • utf8toCodePointsArray - thanks to Nicola Asuni... read more
Posted by Ole K 2013-01-04

Do it yourself - Extensions in version 0.11.5

after some troubles with the encryption we finally fixed the bug #60 submitted by Bartacles.
Bug #61 is also fixed and downloading pdf files as attachment should work now.

In version 0.11.5 is an extensions folder which already contains one extension to support images in table cells plus a dummy extension script to create your own extensions.

Thanks for reporting.

Posted by Ole K 2012-12-29

Repeating background images and 128bit encryption

a new option has been added to repeat the background image (horizontal, vertical or full).
More info:
http://pdf-php.sourceforge.net/pdf-php-code/readme.pdf or the examples/image.php script

A working demo is available on: http://pdf-php.sf.net/pdf-php-code/examples/image.php

I also completed the RC4 128bit encryption which now uses 16 bytes for the encryption key

download the version 0.11.3 here
https://sourceforge.net/projects/pdf-php/files/

Posted by Ole K 2012-12-27

debugging and encryption

These days I have updated the trunk/src/Cpdf.php file to make code analyses more easier.

$DEBUG and $DEBUGLEVEL property has been added to allow the programmer defining the output and level of debug messages.

I also implemented the Revision 3 of PDF 1.4 encryption to support RC4 128 BIT.

Simply use the $pdf->setEncryption($user,$owner, $permissionSet, $mode = 2) to enable it.
Currently a 40bit encryption key is used in both cases . But later step I will allow the programmers to use an encryption key between 40 and 128 bit (5 - 16 bytes)... read more

Posted by Ole K 2012-12-21

PNG support and php5

Finally I have improve the PNG support and replaced some old functions from the source code.

version 011
- object hashing using md5 method to free pdf from redundant images
- PDF output optimization
- image support for transparent PNG - examples/image.php
- removed deprecated function "set_magic_qoutes_runtime" from code lines

Update
The below Patch Summer #1 is not completed due to a mistake. Very soon I will provide the patches in 0.11.1

Posted by Ole K 2012-12-18

Patch Summary #1

Double checked the patches you guys send to us.

I know they became very old but anyway I see a sense to include some of them...

So the following patches are implemented in /branches/1.0.0_php5:

Patch Description
#1 xref position too low; parsing of afm files(https://sourceforge.net/p/pdf-php/patches/1/)
#5 New methods for ezPDF class (partly)(https://sourceforge.net/p/pdf-php/patches/5/)
#8 ezText: First line on new page was placed above top margin(https://sourceforge.net/p/pdf-php/patches/8/)
#10 Image resize behaviour(https://sourceforge.net/p/pdf-php/patches/10/)... read more
Posted by Ole K 2012-12-11