# this is the text which will end up within readme.pdf, when processed
# by readme.php.
#
# the syntax being used is fairly obvious:
#
# a line starting with '#' is a comment or a directive
# 1
is a first level heading (text is 'title')
# 2 is a second level heading (text is 'heading')
#
# the table of contents is automatically generated from the titles and headings.
#
# "#NP" starts a new page
# "#C" starts a code section (put this on a line by itself
# "#c" end the code section
# "#X" and "#x" surround a block which will be executed as php code.
#
# can be used within the text with gleeful abandon
#
# a link can be added within the text using label
1
This class is designed to provide a non-module, non-commercial alternative to dynamically creating pdf documents from within PHP.
Obviously this will not be quite as quick as the module alternatives, but it is surprisingly fast, this demonstration page is almost a worst case due to the large number of fonts which are displayed.
There are a number of features which can be within a Pdf document that it is not at the moment possible to use with this class, but I feel that it is useful enough to be released.
This document describes the possible useful calls to the class, the readme.php file (which will create this pdf) should be sufficient as an introduction.
Note that this document was generated using the demo script 'readme.php' which came with this package.
1
2
- support for underlining in the ezPdf class (but only in the base class functions using the callback function directly).
- improvements to the underlining of the links, so that it is sized and positioned better, will work with angled text now.
- automatic column support.
- some improvements to the table functions. Can set row and column gaps. The table will not now split rows across pages by default.
- addition of transaction control support to the base class (this is quite useful, recommend advanced users take special note).
- numerous small bug fixes, including notably some bugs relating to the inclusion of fonts, especially when using the differences array to take care of characters normally outside the default set.
2
changes to class.pdf.php:
- adjustment to the way that type 1 fonts are loaded to make them more reliable
- changes to that angled text can use bold and italic tags
- implemented file encryption, which gives the ability to restrict user cut and paste, or printing.
- added callback functions activated by text markers, see the misc section for full decription.
- allow object to be added on the 'next' page.
- extended the newPage function to allow insertion of extra pages between existing pages.
- adjustment to ellipse function to allow partial curves.
changes to class.ezpdf.php:
- made the column headings in the tables have the same alignment as the settings for the column data.
- adjusted the size of an A4 page to be more accurate.
- fixed the table title alignment to stay centered on the table if the table position is fixed on the page
- used callback functions to add clickable links to the text.
- implemented a better algorithm for determining table widths when it needs to be shrunk to width.
- changed ezTable and ezText to return the y-position.
- made the page numbering system more functional.
- added insert page functionality.
- added link capability to tables, can specify one column to be links, using another column as URLs.
2
This is it - the james bond version - though all similarity ends with the name, but there are some funky new features and a few bug fixes.
The ezTable features have been extended, it is now possible to define the justification of the individual columns, and to specify colum widths as well as the width of the entire table.
You can now have extra fonts!. It is possible to add type 1 postscript fonts, or TrueType fonts. Though note that for the postscript font you have to have both a .pfb file and a .afm file - but there are free products out there which can convert a .pfa to a .pfb. Also to use a TrueType file you have to have a corersponding .afm file as this is required to specify the character widths - luckily there is a program which will generate one from a ttf file.
Bugfixes:
- fix the open font command so that the font file can be in the same directory.
- fix a bug with full justification, a space was being left at the end of each line - the justification now lines up much better.
- added some binary characters near the start of the pdf file, this is so that transfer programs will recognise it as binary.
- adjusted addTextWrap so that a text angle can now be supplied.
- have found that the reasona that jpeg file loading was not working for a lot of people is that if magic_quotes_runtime is set on in the php.ini file, then the file read is not binary safe. Adjusted the code to turn that option off before the read, then on again afterwards - there is at least one report of it working much better now.
- added the missing code to specify the xPos of a table - this was documented in the last version, but someone forgot to code it.
2
Still more bug fixes of course, but also some improved functionality.
It is now possible to use <b></b><i></i> markers within the text stream to do the obvious functionality. This depends on 'font families' being set up, which are described later.
The table functionality within ezPdf has been enhanced so that the width of a table can be specified and the cell contents will be wrapped to fit.
There is some trial functionality to allow the specification of adjusted character maps, this does mean that this version will have to re-create your 'php_.afm' files, but it will do it automatically on first use, but make sure you have the adobe .afm files in the directory and that the web-server has write access, alternatively download the new ones.
Also there has been a slight attempt to tidy the code a little, and improve the documentation. This is partly in preparation for this project to be put into SourceForge, as it will be immediatly following this release.
2
Contains a few bug fixes from 004, and the addition of the capability to draw arbitrary Bezier curves, and ellipses at arbitrary angles.
2
This release includes a certain amount of functionality which should have been in 003. The enhancements are:
- page numbering easily done within ezpdf, they can be started and stopped on any page, uses an arbitrary template for the format, and can be set to start numbering pages from a given number.
- can now pass content-disposition through to the headers, for what it is worth
- having the 'Accept-Ranges' header set is optional, and off by default - seemed to cause problems.
- lines can now have their width, dash patterns, join types and endings set.
- there is now a reopenObject function which will allow adding content to previous objects, as long as the id has been stored. This function will also now work on pages, and the newpage() function now returns an id so that these can be accessed.
- the first page of course does not return an id, so there is a getFirstPageId() function to find that one.
2
This is the document accompanying version 003 of this pdf class, the significant changes in this class version are:
- Creation of the ezpdf class, an extension to the base class to make life simpler.
Inclusion of compression within the content streams, code from Andrea Gagliardi (thanks).
- A new image function which will include a jpeg file straight from the file, so image inclusion without using GD.
- An extra content header, might improve life on some browsers (thanks John Arthur).
1