pdf troubles

Francesco Sozzi fsozzi at INTERCAD.CH
Fri Dec 17 12:02:39 EST 2004


Hi all,

I'm trying to write map on pdf by use of pdflib.

My code is:

<?php
dl('php_mapscript_44.dll');
dl('php_pdf.dll');


//require 'scripts/ic_php_globals.inc';
$gMapPath="C:/App/MapServer/tutorial/php/Locarno/";
$gMapFile="main.map";
$gHost=http://192.168.1.25;

//create image and URL
$gMap = ms_newMapObj($gMapPath.$gMapFile);
$gMap->setSize(1200,1200);
$gImage=$gMap->draw();
$gImageUrl=$gHost.$gImage->saveWebImage('MS_PNG', 0, 0, 0);

$gPdf = pdf_new();
echo $gImageUrl;
pdf_open_image_file($gPdf, "png", $gImageUrl);

//...

?>

What I get is:

http://192.168.1.25/MapServer/tmp/110330218632641.png
Warning: Internal PDFlib warning: [1910] PDF_open_image_file: Tried to
allocate 0 or negative number of bytes in function pdf_grow_images in
C:\App\MapServer\tutorial\php\locarno\pdf.php on line 16

Fatal error: PDFlib error: [2100] PDF_open_image_file: Function must not be
called in 'object' scope in C:\App\MapServer\tutorial\php\locarno\pdf.php on
line 16

Please note that:
- the URL is right
- I'm using mapserver 4.4 on Windows XP/IIS

Anybody has some suggestions?...

Best regards

Francesco



More information about the mapserver-users mailing list