Adding text/images to an existing PDF

Small, short code snippets that other people may find useful. Do you have a good regex that you would like to share? Share it! Even better, the code can be commented on, and improved.

Moderator: General Moderators

dermoritz
Forum Newbie
Posts: 9
Joined: Fri May 18, 2007 3:13 am

Post by dermoritz »

thx, but what about the warning and the error(i edited my last post)? i guess with out the warning it will work?!

ok, disabled warnings via:
define(DEBUG, "ON");
error_reporting(0);

but the error:

FPDF error: Some data has already been output to browser, can't send PDF file

persists :-(
dermoritz
Forum Newbie
Posts: 9
Joined: Fri May 18, 2007 3:13 am

Post by dermoritz »

ok, i got it.

the was an empty line before the <?php tag. deleting it solved the problem.
dermoritz
Forum Newbie
Posts: 9
Joined: Fri May 18, 2007 3:13 am

Post by dermoritz »

how it is possible to leav all! layout in the template? i want only the data in php. for this example: " 'This document was downloaded at '.date("G:i T", time()).' on '.date("l F jS Y", time()).'. This document is only valid for 24 hours from this date.',0,0,'C'" -without all layout stuff. the template should render all layout.

i think i need a kind of placeholder or reference within the template so that php or fpdi knows where to put data?! and if the layout changes the "where" changes accordingly. like a variable in php, i make an layout with acrobat or open office and set variables in it: "$var"? the php code provides or generates the string $var and replaces it. - how this is realized with fpdi?
bodomalo
Forum Newbie
Posts: 1
Joined: Fri Mar 15, 2013 8:15 am

Re: Adding text/images to an existing PDF

Post by bodomalo »

There is still an obvious error in the code

$tplidx = $pdf->ImportPage(1);

should be replaced by

$tplidx = $pdf->ImportPage($i);


Or it will repeat reading page 1 forever.
kender
Forum Newbie
Posts: 2
Joined: Tue Oct 15, 2013 9:03 am
Location: KC MO

Re: Adding text/images to an existing PDF

Post by kender »

The package at http://fpdi.setasign.de/index.php?p=home is no longer available, is it possible for you to either post the contents, or the document where it can be retrieved?

or, if you have an updated way to do that, a link to the post mentioning it
kender
Forum Newbie
Posts: 2
Joined: Tue Oct 15, 2013 9:03 am
Location: KC MO

Re: Adding text/images to an existing PDF

Post by kender »

new download link for FPDI download is
http://www.setasign.de/products/pdf-php ... downloads/

there are 2 (.zip) files to download, need them both, extract them all into the same folder
Post Reply