[Zope] [possibly OT] html2pdf on zope

Bob Corriher bobc@p-wave.com
Fri, 21 Mar 2003 10:09:41 -0500


When I use it on Linux (RedHat 8.2), I use the method in the how-to with 
no changes and haven't had any problems. I only saw the "file does not 
start with %PDF" problem on Windows. The popen2 call was returning a 
file in text mode instead of binary mode.

Popen2 is documented here: 
 http://www.python.org/doc/current/lib/module-popen2.html

Looking at the documentation, it says that the default mode is  't' 
(text) , so perhaps the mode parameter is required for Linux also, 
although it works for me without it.

Bob Corriher
P-Wave Inc


AM wrote:

> But how do I get it to work on Linux then??
> TIA
> AM
>
> Bob Corriher wrote:
>
>>
>> Hi Bo,
>>
>> My bad. I didn't mean that HTMLDoc wouldn't work on Linux, just that 
>> the 'b' parameter to popen2 probably isn't the problem, as it is the 
>> default in the Linux python library.
>>
>> I've had good success with HTMLDoc for most projects. I do use 
>> ReportLab for database type reports, but not where I already have 
>> HTML code generated as HTMLDoc does a much better job of that. It 
>> does not support CSS however, so I sometimes have to generate 
>> alternate HTML using the <FONT> tag and other "standard" HTML 
>> constructs.
>>
>> You're right about parsing with Reportlab. I originally started using 
>> HTMLDoc when some of our users began embedding HTML in content and it 
>> became more and more difficult to handle the tags in Reportlab.
>>
>> I'm not sure if Unicode will cause you a problem in HTMLDoc as I've 
>> not had to use it.
>>
>> Reportlab and HTMLDoc are the only PDF generation tools I've used and 
>> I don't know of any others.
>>
>> Bob Corriher
>> P-Wave Inc.
>>
>>
>> Bo M. Maryniuck wrote:
>>
>>> On Wednesday 19 March 2003 18:47, Bob Corriher wrote:
>>>  
>>>
>>>> If you're on Linux or Unix, this probably isn't the answer.
>>>>   
>>>
>>> Have you good solution to use Unicode with it? I would not like to 
>>> start coding a parser with ReportLab. But if no solution, I will... :/
>>>
>>>  
>>>
>>
>