jussiniinikoski / wasm-pdf

Generate PDF files with JavaScript and WASM (WebAssembly)
Apache License 2.0
479 stars 51 forks source link

Custom TextSpans #28

Open Jamie0 opened 2 years ago

Jamie0 commented 2 years ago

It would be useful to be able to specify custom TextSpans (perhaps either as contents of a Paragraph object, or in a new obj_type). This would allow for mixing and matching of fonts/styles in inline text and make wasm-pdf much more flexible for generating text-based documents.

In our particular use case, we would like to be able to generate a PDF from user-supplied rich text, but wasm-pdf only currently supports bold and hyperlink styles inline. Converting from HTML to a JSON object is straightforward enough in modern browsers

jussiniinikoski commented 2 years ago

Thanks for the idea! I'll need to look into this later...