Opened 17 years ago

Closed 13 years ago

#2337 closed defect (fixed)

PDF Format - msDrawQueryMap(): Unable to initialize image

Reported by: tmelhuish Owned by: mapserverbugs
Priority: normal Milestone:
Component: Output-PDF Version: 4.10
Severity: normal Keywords: pdf drawQuerymap
Cc:

Description

I receive the following error message when trying to create a PDF file using the PDF Format and drawQueryMap in PHP:

msDrawQueryMap(): Unable to initialize image

I'm using: Mapserver 4.10.3 GD 2.0.35 PdfLib-lite 7.0.1

Attached is a test php script and a mapfile to recreate the problem.

The output format for PNG works fine but PDF fails. If I use drawMap versus drawQuerymap is works fine as well.

I looked at bug fix 2017, but was not sure if this would fix my problem. I see for some reason that this didn't make it into the 4.10.3 release.

Thanks in advance for your help, Tom

Attachments (2)

pdftest.php (969 bytes ) - added by tmelhuish 17 years ago.
Pdf test script to change format & draw options
pdf1.map (2.5 KB ) - added by tmelhuish 17 years ago.
Mapfile to show format options. You need to copy in your own layer data

Download all attachments as: .zip

Change History (5)

by tmelhuish, 17 years ago

Attachment: pdftest.php added

Pdf test script to change format & draw options

by tmelhuish, 17 years ago

Attachment: pdf1.map added

Mapfile to show format options. You need to copy in your own layer data

comment:1 by tmelhuish, 17 years ago

I added the following lines of code before the "Unable to initialize image" error message in the mapdraw.c code. I also removed the FORMATOPTION "OUTPUT_TYPE=RASTER" in the mapfile which seam to fix the problem. Why was this removed in the mapserver 4.10.3 code that I am using?

#ifdef USE_PDF

else if( MS_RENDERER_PDF(map->outputformat) ) {

image = msImageCreatePDF(map->width, map->height, map->outputformat,

map->web.imagepath, map->web.imageurl, map);

}

#endif

comment:2 by sdlime, 17 years ago

Component: MapServer C LibraryOutput-PDF
Owner: changed from sdlime to mapserverbugs

comment:3 by tbonfort, 13 years ago

Resolution: fixed
Status: newclosed

probably invalid since the 6.0 pdf rewrite. reopen if necessary.

Note: See TracTickets for help on using tickets.