Page 1 of 1

PDF erzeugen

PostPosted: 11. November 2003 15:39
by Smurf
Hallo,
ich verwende XAMPP für Windows und möchte die PDF-Generierung on the fly verwenden.
Die mitgelieferten Beispiele funktionieren auch problemlos.
Wenn ich den nachfolgenden Code in meinen als Funktion mit einbaue,
bekomme ich beim Aufruf folgende Fehlermeldung

"Cannot modify header information - headers already send by ..."

Wer kann mir da weiterhelfen ?

Danke
Gruss
Bernd
:cry:

Code:

function .... {
include 'class.ezpdf.php';
pdf->selectFont('./fonts/Helvetica');
$pdf =& new Cezpdf();
$pdf->ezText('',12);
$pdf->addText(60,720,5,'ApacheFriends · WAMPP · www.apachefriends.org');

pdf->ezStream();

}

Dieses ist nicht auf englisch, aber ich versuche irgendwie.

PostPosted: 11. November 2003 19:13
by MAGnUm
ich verstehe, was Sie fragen, aber dieses ist das englische Forum gefallen so bitten um um es im englischen folgenden Zeitdank.

in english:
yeh the script is outputting headers before your function is called, you might want to put that include before anything else in your script ie

Code: Select all
<?php
include 'class.ezpdf.php';
...


this should fix it, because it seems since the code you have included is not attempting to output any headers i can only assume that the include file is. so to sum it up get the include 'class.ezpdf.php'; out of the function.

PostPosted: 20. November 2003 11:11
by Smurf
I inclued the 'class.ezpdf.php' in the very first file;
but now, if I try to call the function I get the following error message:
"Fatal error: Cannot instantiate non-existent class: cezpdf in ..."

Any Ideas?
Regards
Smurf

include

PostPosted: 20. November 2003 16:33
by MAGnUm
yeh, umm... i have no idea then. whatever is in that include file is outputting additional headers, since you are making a pdf file i assume these are the pdf headers so the browser knows to call the plugin. please go into the include file and look for anything that outputs header info or sets doctype. and put it in your script rahter than the include. also put the include back where it was.