[reportlab-users] PDF File corrupt

Dani Reguera dreguera at tagzania.com
Fri Dec 4 10:52:09 EST 2009


It could be the images?? I have choosen 4 png images and added to the file
and now seems that is not corrupted but I cant see them.

Now I can open the file but I see anything.

please help.


2009/12/4 Robin Becker <robin at reportlab.com>


> Dani, thanks for the code, but I think we need to have a sample image that

> actually causes a problem. I see nothing objectionable here, but we have

> seen jpegs that cause a problem. Presumably SUBTITLE is the name of a file.

> --

> Robin Becker

>

>

> Dani Reguera wrote:

>

>> Here is the code:

>>

>> from reportlab.pdfgen import canvas

>> from reportlab.lib.pagesizes import landscape,A4

>> from reportlab.pdfgen.textobject import PDFTextObject

>> from reportlab.lib.colors import HexColor

>> from reportlab.pdfbase import pdfmetrics

>>

>> mycanvas = canvas.Canvas(SUBTITLE,pagesize=landscape(A4))

>>

>>

>> mycanvas.drawImage(styles['credits']['path'],int(styles['credits']['x'])*mm,int(styles['credits']['y'])*mm,width=int(styles['credits']['width'])*mm,height=int(styles['credits']['height'])*mm,

>> mask='auto')

>>

>> kk = canvas.textobject.PDFTextObject(mycanvas)

>> kk.setTextOrigin(x=0*mm,y=0*mm)

>> kk.textOut(text)

>>

>> mycanvas.drawRightString(x*mm,y*mm,text)

>>

>> mycanvas.showPage()

>> mycanvas.save()

>>

>> ..........

>

> _______________________________________________

> reportlab-users mailing list

> reportlab-users at lists2.reportlab.com

> http://two.pairlist.net/mailman/listinfo/reportlab-users

>




--

Dani Reguera
dreguera at tagzania.com

Tagzania Services [www.tagzania-services.com]
Azitaingo Industrialdea 3 K
E-20600 Eibar
Tel: (+34) 943 82 17 80
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://two.pairlist.net/pipermail/reportlab-users/attachments/20091204/f3c236e0/attachment.html>


More information about the reportlab-users mailing list