[ale] building pdf from python with reportlab

Alex Carver agcarver+ale at acarver.net
Tue Aug 26 13:25:51 EDT 2014


The dirty secret of PDF is that it's really PostScript with a different
first line header.  The first line starts %PDF instead of %!PS.  After
that it is entirely PostScript Level 1 code (most of the time).  What
sometimes happens is that the generated file is PostScript that reads
self-contained binary blobs which are images of the text rather than
text itself so it's no longer human readable except for the PostScript
commands.  The actual data that is rendered has been encoded.

Other PDFs aren't quite as evil and will be the raw readable text plus
all the PostScript font formatting to pretty print it.

Open it up, see what's in there. :)

On 2014-08-26 07:56, Jim Kinney wrote:
> It makes a PDF directly (no accessible PS intermediate file). I've not
> converted pdf2ps.
> On Aug 26, 2014 10:53 AM, "Alex Carver" <agcarver+ale at acarver.net> wrote:
> 
>>
>>
>> On 2014-08-26 07:37, jkinney wrote:
>>> I'm trying to generate a 1-page pdf that has some text and a single
>>> image (a qrcode) and I'm hitting issues. The docs for reportlab are a
>>> better than many but still missing key details. The following will
>>> generate the page, the text starts at the correct location, BUT the
>>> text runs vertical down the page. I have found nothing that indicates
>>> how to do that or fix it. By vertical down the page I mean:
>>> l
>>> i
>>> k
>>> e
>>>
>>> t
>>> h
>>> i
>>> s
>>>
>>> grr! That _really_ messes up ascii art!
>> <snip>
>>
>>
>> What does the generated PostScript look like (assuming it's generating
>> actual, human readable PS code and not a binary blob wrapped in PS)?
>> _______________________________________________
>> Ale mailing list
>> Ale at ale.org
>> http://mail.ale.org/mailman/listinfo/ale
>> See JOBS, ANNOUNCE and SCHOOLS lists at
>> http://mail.ale.org/mailman/listinfo
>>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://mail.ale.org/pipermail/ale/attachments/20140826/0347477f/attachment.html>
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://mail.ale.org/mailman/listinfo/ale
> See JOBS, ANNOUNCE and SCHOOLS lists at
> http://mail.ale.org/mailman/listinfo
> 
> 



More information about the Ale mailing list