简体   繁体   English

如何将插入 svg(qr) 添加到 pdf 文件? Ruby 上导轨

[英]How to add insert svg(qr) to pdf file? Ruby on rails

i use RQRCode to create qr code and want after that insert my svg( not one a few ) in a pdf.我使用 RQRCode 创建二维码,然后希望将我的 svg(不是几个)插入 pdf。
Can i do it with nokogiri?我可以用 nokogiri 做吗? or how to do it?或者怎么做? Should i convert qr to xml and next insert this xml(qr) to xml(pdf-file) and after that convert xml to pdf?我应该将 qr 转换为 xml,然后将此 xml(qr)插入 xml(pdf 文件),然后将 xml 转换为 Z437175BA4191210EE004E1D937494D09

You can use prawn-svg to directly embed the SVG into a PDF document generated by Prawn.您可以使用prawn-svg将 SVG 直接嵌入到 Prawn 生成的 PDF 文档中。

If that doesn't work for you, convert the SVG to an image format like PNG and then include that image.如果这对您不起作用,请将 SVG 转换为 PNG 等图像格式,然后包含该图像。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM