[reportlab-users] embedded png image quality

James Crone james.crone at ed.ac.uk
Thu Jan 10 07:30:09 EST 2008


Hi,

I`m embedding a PNG image (a map rendered from MapServer) into a pdf
using reportlab with:

import Image
from reportlab.pdfgen import canvas
from reportlab.lib.pagesizes import portrait,A4

myImage = Image.open("C:/input_map_image.png")
bgsMapCanvas = canvas.Canvas("C:/output_map_doc.pdf",pagesize=portrait(A4))
bgsMapCanvas.setPageCompression(0)
bgsMapCanvas.drawInlineImage(myImage,0,0,myImage.size)
bgsMapCanvas.showPage()
bgsMapCanvas.save()


in the resulting pdf the embedded PNG image has been compressed
resulting in a loss of image quality and a fuzzy map document :-( . Is
it possible to prevent (PNG) images from being compressed when I add
them to a document?

Thanks in advance,

James

--
James Crone

Geo Data and Research Services
EDINA
Causewayside House,
160 Causewayside,
Edinburgh,
Scotland,
United Kingdom
EH9 1PR

tel: +44 (0)131 651 1859
http://edina.ac.uk

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Are you looking for help or information about "geo" related resources?
Try Go-Geo! http://www.gogeo.ac.uk
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



More information about the reportlab-users mailing list