Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_php thread: Re: Hi There I have installed the PDF module in my system


Message #1 by "Srinivasan Ramakrishnan" <srinivar@m...> on Thu, 8 Mar 2001 18:16:52 +0530
> Can you tell me what´s next remember the printing question thanks???
>
> Jorge Cordero

Ok, great first you have to tell me which of the 2 available PDF modules you
installed.

One is PDFlib -  http://www.pdflib.com/pdflib/index.html (Totally free)
(Needs JPEG [ ftp://ftp.uu.net/graphics/jpeg/ ] &
TIFF [ http://www.libtiff.org/ ] libraries to compile)

the other is ClibPDF - http://www.fastio.com/
(free for private, non-profit use, but a commercial license is required for
for-profit applications)
/*ClibPDF - Supposedly faster, allows smaller files, read the license*/

Once you locate which module is installed go to

http://php.net/manual/en/ref.cpdf.php
if you have ClibPDF, or

http://php.net/manual/en/ref.pdf.php
if you have PDF lib.


This is the manual for these modules, complete with a list of functions to
use.
(BTW, I'd recommend downloading a copy of the latest manual unless you are
on a fat pipe!)

Step 1:
Now before you start reading the manual, depending upon the module you have
copy & paste the example no. 1's code.
Read it, there is an explanation included. The examples are simple & will
serve the purpose. Once the examples execute, and a PDF file is produced,
you know all is well.

Step 2:
No errors:
=========
If you have no errors, start reading the manual & play around with the
functions. If the text that you want outputted as PDF is mainly text, the
functions are easily generalizable. You can have a header (optional) with
your website's name, the date of the document etc. Then the body of the
document, and finally a footer (optional).

All of this is easy if you have access to the text of the document from a
database, but if you have them as a set of HTML files, it needs some
parsing. Forget this route if all you have is a set of totally different
HTML documents, each with it's own patterns, and especially with images &
stuff. You are better of converting by hand.

Errors:
=======
If you have errors in running example 1, make sure you haven't made a
mistake in the PHP code, and if all is correct, we may need to investiagte
your module setup, see if it is set up properly in PHP.ini etc. Another
great test is to run phpinfo() and see if all the status variables of the
PDF/clibPDF module are ok.

Whew!!

Have a look at all this, and please respond to the list.

Cheers,
-Srini

P.S: Remember this started out with you wanting to have control over the
printing, not wanting to add a header / footer that web browsers normally
add. Please consider whether this is all worth it. Generating custom PDF
documents is an art in itslef, and can take some doing. If a notice asking
web surfers to remove their headers & footers is feasible, why not try that.
Also try www.meadroid.com, they have some IE specific scriptable ActiveX
objects that will allow you to control the printing.
Having said that, this is a PHP list, and that is why I'm suggesting the PDF
option. It is also the safest bet if you can master the trick. However, the
web surfer will require a PDF viewer like Adobe Acrobat to view the PDF docs
that are sent to him.

--
http://www.sriniram.com
http://symonds.net/~sriniram





  Return to Index