如何从Google的appengine动态生成pdf?

时间:2022-06-21 09:34:46

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

我想创建一个可以在Google的appengine上运行的应用程序。

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

但是,此应用程序需要能够动态生成PDF。

How could I do this?

我怎么能这样做?

4 个解决方案

#1


25  

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.

您可以使用reportlab库从Python生成PDF。您可以将ReportLab文件包含在应用程序的代码中,也可以包含ReportLab代码的zip存档,并将其插入应用程序的sys.path中。

#2


7  

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..

要克服google appengine中的文件数限制,您可以将reportlib打包到zip文件中并使用它。请务必查看我遇到的这个问题..

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.

此外,您可以使用pisa,htmllib和pyPdf使用html模板生成pdf。

All the best.

祝一切顺利。

varun

#3


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.

我推荐PyFPDF,它是轻量级但功能强大的PHP FPDF库的纯Python端口。它几乎不是几十千字节。

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

#4


3  

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

谷歌有一个新的“转换API”,可以解决你所有的问题。以下是该网站的说明:

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).

App Engine Conversion API使用Google的基础架构在常见文件类型之间转换文档,以提高效率和扩展。该API支持HTML,PDF,文本和图像格式之间的同步或异步转换,并具有执行光学字符识别(OCR)的选项。

#1


25  

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.

您可以使用reportlab库从Python生成PDF。您可以将ReportLab文件包含在应用程序的代码中,也可以包含ReportLab代码的zip存档,并将其插入应用程序的sys.path中。

#2


7  

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..

要克服google appengine中的文件数限制,您可以将reportlib打包到zip文件中并使用它。请务必查看我遇到的这个问题..

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.

此外,您可以使用pisa,htmllib和pyPdf使用html模板生成pdf。

All the best.

祝一切顺利。

varun

#3


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.

我推荐PyFPDF,它是轻量级但功能强大的PHP FPDF库的纯Python端口。它几乎不是几十千字节。

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

#4


3  

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

谷歌有一个新的“转换API”,可以解决你所有的问题。以下是该网站的说明:

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).

App Engine Conversion API使用Google的基础架构在常见文件类型之间转换文档,以提高效率和扩展。该API支持HTML,PDF,文本和图像格式之间的同步或异步转换,并具有执行光学字符识别(OCR)的选项。