Forum Documentation

Looking for some php to pdf documentation..

I'm brand new to prince and was wondering where I could find any documentation on creating dynamic invoices.. Can prince even change .php files to PDF? I'm not finding the info I need to learn more about this and was wondering if somebody can point me to that info..

The Prince PHP wrapper includes methods for converting files or strings into PDF. However, you probably have some PHP pages generating invoices for the browser, and you want to return a PDF instead. We don't yet offer a one-line call to do this, but it should be possible to do it using the ob_start and ob_get_clean functions, like this:


// your code to generate invoice HTML goes here

$out = ob_get_clean();

$prince = new Prince('/usr/bin/prince');


header('Content-type: application/pdf');


The ob_start function begins output buffering, so PHP will buffer up the HTML internally instead of returning it to the browser, then ob_get_clean wipes the buffer and returns it as a string so that the generated HTML can be converted to PDF by Prince and the PDF returned to the browser with an appropriate content-type so that the browser knows what to do with it.

How is that? :D
Is there any php function that will get HTTP_POST_VARS and each var to some array?

For example:

The function should return arrayvariable1=value1 and arrayvariable2=value2
Not sure what you are asking, how to use the $_POST array? The PHP documentation should cover this, just google for "$_POST".
but when i am doing what u have told the css styling is missing... !!!
Can we take this back to the other thread? Otherwise it will get very confusing. :)
I have to create a pdf file and dynamically save it to a fixed directory other than downloads and then after , i have to dynamically mail it to an address which has to be fetched from my database .
I'm using fpdf for pdf generation . .
Is this possible ? how ?
I think this is a PHP question, or possibly an FPDF question, not a Prince question. So you might want to take this to StackOverflow, or a PHP forum.
ok . thanks for the help ,