PDF erzeugen

Problems with the Windows version of XAMPP, questions, comments, and anything related.

PDF erzeugen

Postby Smurf » 11. November 2003 15:39

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();

}
Smurf
 
Posts: 7
Joined: 29. October 2003 13:13

Dieses ist nicht auf englisch, aber ich versuche irgendwie.

Postby MAGnUm » 11. November 2003 19:13

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.
~~:M A G n U m:~~
(Disclaimer: if any of this info is confusing or vague tough, its free!!)
User avatar
MAGnUm
 
Posts: 151
Joined: 16. October 2003 18:08
Location: USA

Postby Smurf » 20. November 2003 11:11

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
Smurf
 
Posts: 7
Joined: 29. October 2003 13:13

include

Postby MAGnUm » 20. November 2003 16:33

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.
~~:M A G n U m:~~
(Disclaimer: if any of this info is confusing or vague tough, its free!!)
User avatar
MAGnUm
 
Posts: 151
Joined: 16. October 2003 18:08
Location: USA


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 94 guests