Transparent PDF not generating with transparent background
----------------------------------------------------------
Key: GEOS-709
URL: http://jira.codehaus.org/browse/GEOS-709
Project: GeoServer
Issue Type: Bug
Components: WMS
Affects Versions: 1.4.0-M1, 1.4.0-M0, 1.3.3, 1.3.2, 1.3.1, 1.3.0
Reporter: Courtney Palit
Assigned To: Gabriel Roldán
Priority: Minor
Fix For: 1.4.0-M1, 1.4.0-M0, 1.3.3, 1.3.2, 1.3.1, 1.3.0
Attachments: comparison.png
When specifying a transparent PDF as the output from the WMS, the background is not transparent. A testcase for this is http://localhost:8080/geoserver/wms?bbox=145.19754,-43.423512,148.27298,-40.852802&styles=line&Format=application/pdf&transparent=true&request=GetMap&layers=topp:tasmania_roads&width=2048&height=2048&srs=EPSG:4326
A fix: remove line 175 from the org.vfny.geoserver.wms.responses.map.pdf.PDFMapProducer class. Line 175 is in the produceMap() method, and currently looks like this:
pageSize.setBackgroundColor(new java.awt.Color(0xFF, 0xFF, 0xDE));
If line 175 is removed, the background of the PDF page is transparent, and the transparency check on line 198 continues to work by putting an opaque background or transparent background image on the PDF page.
Alternatively, if the yellow background for non-transparent PDFs is desired, line 175 can be wrapped with a transparency check statement like this:
if (!map.isTransparent()) {
pageSize.setBackgroundColor(new java.awt.Color(0xFF, 0xFF, 0xDE));
}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira