Pisa erzeugt ein kaputtes PDF
Verfasst: Samstag 19. September 2009, 22:33
Hallo
Ich möchte mit dem Python-Modul pisa bestimmte Html-Strings in ein PDF umwandeln.
(System: Kubuntu 9.04 mit Python 2.6 und pisa 3.0.32
Leider klappt noch nicht einmal das Beispiel aus dessen Doku:
Wenn ich das ausführe, kommen zwei Warnings auf der Shell:
Komischerweise bekomme ich eine anstandsloses PDF-File, wenn ich pisa als Konsolenkommando benutze. Dort werden mir aber auch die zwei Warnings ausgegeben.
Kann mir jemand weiterhelfen?
Danke
Ich möchte mit dem Python-Modul pisa bestimmte Html-Strings in ein PDF umwandeln.
(System: Kubuntu 9.04 mit Python 2.6 und pisa 3.0.32
Leider klappt noch nicht einmal das Beispiel aus dessen Doku:
Code: Alles auswählen
import ho.pisa as pisa
def helloWorld():
filename = "test.pdf"
pdf = pisa.CreatePDF("Hello <strong>World</strong>", file(filename, "wb"))
if not pdf.err:
pisa.startViewer(filename)
if __name__=="__main__":
pisa.showLogging()
helloWorld()
Das erste kann ich mir ja auch als Anfänger noch erklären. Aber das zweite?Warning (from warnings module):
File "/var/lib/python-support/python2.6/pyPdf/pdf.py", line 52
from sets import ImmutableSet
DeprecationWarning: the sets module is deprecated
Warning (from warnings module):
File "/usr/local/lib/python2.6/dist-packages/html5lib-0.11.1-py2.6.egg/html5lib/inputstream.py", line 367
DeprecationWarning: object.__init__() takes no parameters
Komischerweise bekomme ich eine anstandsloses PDF-File, wenn ich pisa als Konsolenkommando benutze. Dort werden mir aber auch die zwei Warnings ausgegeben.
Kann mir jemand weiterhelfen?
Danke