Creating PDF Report

478
1
09-21-2011 04:54 PM
ShaunWeston
Occasional Contributor
I'm just trying to figure out how to produce a report with Python. I normally use ReportLab to build a PDF report from scratch, but what I want to do now is add text into an exsiting report template.

So, I will have a PDF template report with some gaps where the dynamic text will go and then I would like to write a python script to add the dynamic bits into the gaps. I thought this would be simple, but ReportLab does not seem to be able to accomplish this, it seems to be only able to create PDFs from scratch. I've had a brief look at PyPDF, but not sure how that works.

The other option would be to just write up the entire template in a MXD. This would be the easiest solution for me, but not so much for the users who would want to setup templates in Word, which could then be easily converted to PDFs.

Has anyone has any experience with doing this?
Tags (2)
0 Kudos
1 Reply
ShaunWeston
Occasional Contributor
Actually I've found a better way of doing this using the win32.client to open up the Word document, then do a find in replace with some code. Brilliant!
0 Kudos