as the QR-Code is SVG, we have to insert it as a `FormXObject`
you will have to use https://docs.rs/svg2pdf/latest/svg2pdf/
to convert the SVG into a FormXObject
with `to_chunk`
then add more chunks (the text that goes below the SVG) and give them to `pdf_writer` (which is included in svg2pdf)
https://docs.rs/pdf-writer/0.10.0/pdf_writer/struct.Chunk.html
example to add text:
https://github.com/typst/pdf-writer/blob/main/examples/hello.rs
https://github.com/typst/pdf-writer/blob/main/examples/chunks.rs
and then output the final PDF.
Estimated time: 2 days
use this library for PDF generation, it works with WASMhttps://github.com/pdf-rs/pdf
as the QR-Code is SVG, we have to insert it as a
FormXObject
you will have to use https://docs.rs/svg2pdf/latest/svg2pdf/
to convert the SVG into a FormXObject
with
to_chunk
then add more chunks (the text that goes below the SVG) and give them to
pdf_writer
(which is included in svg2pdf)https://docs.rs/pdf-writer/0.10.0/pdf_writer/struct.Chunk.html
example to add text:
https://github.com/typst/pdf-writer/blob/main/examples/hello.rs
https://github.com/typst/pdf-writer/blob/main/examples/chunks.rs
and then output the final PDF.