使用 Ruby on Rails 的 Wicked PDF 中的模板选项

发布于 2024-12-04 12:33:11 字数 243 浏览 5 评论 0原文

我想知道,我们可以使用 pdf 文件作为模板,使用 Ruby on Rails 使用 WickedPDF 编写内容吗?这意味着我将访问带有页眉和页脚的 PDF 文件,WickedPdf 将使用该模板在其上写入文本。

https://github.com/mileszs/wicked_pdf

谢谢 尼尚特

I would like to know , can we use a pdf file as template to write the content using WickedPDF using Ruby on Rails. That means i will be accessing a PDF file with Header and footer on it and WickedPdf will use that template to write text on it.

https://github.com/mileszs/wicked_pdf

Thanks
Nishant

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

依 靠 2024-12-11 12:33:11

不,您可以像 Rails 中的任何标准视图一样编写模板,即 html.erbhaml,并且这将作为可下载的 PDF 提供给用户。

如果您创建视图(正如我详细信息请参阅您之前的 SO 问题),并将该视图传递给 WickedPDF,您将把图像上的文本输出作为 PDF。

No, you write your template like any standard view in Rails, i.e. html.erb or haml, and this will be served up as a downloadable PDF to the user.

If you create your view (as I detailed in your earlier SO question), and pass that view to WickedPDF, you will have your text-on image output served as a PDF.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文