Have you tried using a different font? I've had occasional problems with
PDFs apparently being corrupted when using the font "Arial Unicode MS".
When I try a different font, the problem goes away.
Hope that helps,
Simon
You should post either some python code that generates the pdf, and or the pdf.
--
Carl K
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()
>
..........
Can you try slightly resizing or changing the 4 images using some
well-known tool? e.g Gimp, Paint.NET, Photoshop.
We know that some 'buggy images' have confused Adobe Reader in the
past. I have even known images in PDFs to make a printing press
crash. Usually changing the image file fixes this.
Best Regards,
--
Andy
Try using this png:
http://www.reportlab.org/media/imadj/data/RLIMG_6845acae97ac366a765e5acb5b8ac27f.PNG
--
Carl K
I am saying that it is possible to create a 'buggy PNG' which may view
OK in some tools but not others. To eliminate this possibility, use
some well known image library to change them. If you converted from
PNG to GIF and back to PNG again, saving each time, and it worked
afterwards, you'd know there was a fault with the original image.
We're closing the office now for the weekend, but if this does not
work and you can send us your PNGs or put them somewhere we can see
them, we will take a look on monday.
- Andy
Look, none of us are mind readers!!! The rest of create many, many,
many PDFs every day that all work fine. We cannot possibly help you
unless you send us a PDF file that doesn't work, and/or runnable Python
code to create a file that fails. The code you sent was NOT runnable,
because the names "SUBTITLE" and "styles" were not defined.
Can't you see how frustrating it is for you to say "Reportlab generates
corrupted PDF files. Why?" That question cannot possibly be answered.
--
Tim Roberts, ti...@probo.com
Providenza & Boekelheide, Inc.
There are a variety of ways you could handle it. If you are using
platypus you can replace newlines with a break, a new paragraph
flowable, etc.
If you aren't using platypus, try doing a python split on the newline
and then write a new line for each element in your array of text
lines.