PDA

View Full Version : PDFLIB TIFF image problem


abdul04
August 16th, 2004, 12:07 AM
Hi ALL!
I have PDFlib GmbH Version 4.0.2 library installed on my Windows 2K machine with PHP Version 4.3.2. Generating PDF files is working fine in my case and even I can place jpg images fine in the PDF document but problem occours When I want to Add some Tiff Images to a PDF file, som errors occours and php script crashes with an error message that error message is
Server Error, unable to connect to fastcgi server.
So is there any one who can help me with the above problem. Following is the Code I am using.
<?php
$radius = 200;
$margin = 20;
$pdf = pdf_new();

if (!pdf_open_file($pdf, ""))
{
echo error;
exit;
};

pdf_set_parameter($pdf, "warning", "true");
pdf_set_parameter($pdf, "imagewarning", "true");

pdf_set_info($pdf, "Creator", "getpdf.php");
pdf_set_info($pdf, "Author", "Abdul");
pdf_set_info($pdf, "Title", "Abdul's Test");

// end of while loop here
pdf_begin_page($pdf, 2 * ($radius + $margin), 2 * ($radius + $margin));
//$pdfimage = pdf_open_image_file($pdf, "jpeg", "pic1.jpg");
$pdfimage = pdf_open_image_file($pdf, "tiff", "foodv008.tif");

pdf_end_page($pdf);


pdf_close($pdf);

$buf = pdf_get_buffer($pdf);
$len = strlen($buf);

header("Content-type: application/pdf");
header("Content-Length: $len");
header("Content-Disposition: inline; filename=foo.pdf");
echo $buf;

pdf_delete($pdf);
?>

degsy
August 16th, 2004, 12:15 AM
Welcome :)

If TIFF supported in version 4?

Version 6
http://www.pdflib.com/products/pdflib/features.html


Imagesembed BMP, GIF, PNG, TIFF*, JPEG, and CCITT raster images


This page lists all the major features of PDFlib 6 – including PDFlib, PDFlib+PDI and the PDFlib Personalization Server (PPS) – for generating and importing PDF.
Features new in PDFlib 6 are marked with *.