How to dynamically generate a pdf from Google's appengine?

ぐ巨炮叔叔 提交于 2019-11-28 15:09:16

问题


I'd like to create an application that would run on Google's appengine.

However, this application needs to be able to generate PDFs dynamically.

How could I do this?


回答1:


You can use the reportlab library to generate a PDF from Python. You can just include the ReportLab files in with your application's code, or you can include a zip archive of the ReportLab code, and insert it into your application's sys.path.




回答2:


To overcome the number-of-files limit in google appengine, you could package your reportlib in a zip file and use it. Be sure you check out this issue i bumped into..

http://code.google.com/p/googleappengine/issues/detail?id=1085

Also, you can use pisa, htmllib and pyPdf to generate the pdf using html templates.

All the best.

varun




回答3:


I would recommend PyFPDF, which is a pure-Python port of the lightweight yet highly powerful PHP FPDF library. It is hardly a few dozen kilobytes.

See http://code.google.com/p/pyfpdf/




回答4:


Google has a new "Conversion API" that may solve all your problems. Here's a description from the site:

The App Engine Conversion API converts documents between common filetypes using Google's infrastructure for efficiency and scale. The API enables conversions between HTML, PDF, text, and image formats, synchronously or asynchronously, with an option to perform optical character recognition (OCR).



来源:https://stackoverflow.com/questions/327700/how-to-dynamically-generate-a-pdf-from-googles-appengine

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!