I want to make use of some PDFlib functions (like pdf_stringwidth()), but I don't want to generate and output a pdf. I just want to show some html with results of the calculations. Something like this:
// Create pdf-object
$rPdf = pdf_new();
// Open the pdf-object
pdf_open_file($rPdf);
// Set font
$iFont = pdf_findfont($rPdf, "Helvetica", "host", 0);
// Do some calculations
....
// Close the pdf
pdf_close($rPdf);
// Delete pdf-resource
pdf_delete($rPdf);
But if I run the previous code, I get the error message:
"Fatal error: PDFlib error: Empty document in ...".
Do I always have to generate some output? Why can't I just close and delete the pdf-resource? Does anyone have an idea?