Django - 创建和创建使用 XHTML2PDF 存储 PDF 文件
到目前为止,我们正在使用 XHTML2PDF 动态生成 PDF 并在需要时输出到浏览器。现在我们的要求改为只生成一次PDF并将其存储在服务器中。应向用户显示链接以查看 PDF。您能否指出实现此目标的任何资源或片段?
As of now we are using XHTML2PDF to dynamically generate PDFs and outputting to browser whenever required. Now our requirements is changed to generate the PDF only once and store it in the server. The link should be displayed to user to view the PDF. Could you please point out any resources or snippets to achieve this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

这很容易做到。观察:
get_pdf_contents 函数不应该太难编写 - 基本上采用您已有的任何函数并在将结果汇集到 HttpResponse 对象之前将其删除。如果您需要帮助,请发布您已有的代码。
This is pretty easy to do. Observe:
The get_pdf_contents function shouldn't be too hard to write - basically take whatever function you have already and chop it off before it funnels the results into an HttpResponse object. If you need help with that, post the code you have already.