Should have gone to the list in the first place! Sorry, Sibylle
Am 16.04.2011 20:46, schrieb Adrian Klaver: > > Actually it does seem to work. Using the demo invoice.rfxml file either of the > methods below seem to work: > > pdfName = "myreps.pdf" > rw = ReportWriter() > with open(pdfName, "w") as outFile: > rw.ReportFormFile = "invoice.rfxml" > rw.OutputFile = outFile > # for testing > rw.UseTestCursor = True > rw.write(save=False) > rw.ReportFormFile = "invoice_2.rfxml" > rw.UseTestCursor = True > rw.write() > outFile.close() > > Note the outFile.close() > > or stealing shamelessly from the reportWriter.py code: > > import tempfile > pdfName = "myreps.pdf" > rw = ReportWriter() > with open(pdfName, "w") as outFile: > rw.ReportFormFile = "invoice.rfxml" > rw.OutputFile = tempfile.TemporaryFile() > # for testing > rw.UseTestCursor = True > rw.write(save=False) > rw.ReportFormFile= "invoice_2.rfxml" > rw.UseTestCursor = True > rw.write() > rw.OutputFile.seek(0) > outFile.write(rw.OutputFile.read()) > outFile.close() > Using Linux and Evince as document viewer, yes, it works as expected. On Windows with Acrobat Reader (V. 9.4.3 or 10.0.1) previewPDF() shows empty pages and after a little time an error message appears (translated: Error on reading this document (14)). So either the PDF isn't quite correct, but Evince is more tolerant, or Acrobat Reader is at fault. Thank you, Sibylle _______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users Searchable Archives: http://leafe.com/archives/search/dabo-users This message: http://leafe.com/archives/byMID/[email protected]
