Convert SVG to PDF With Non Standard (or Custom) Fonts in Aspose.PDF REST API

Hello,

Is there a preferred method for including custom fonts (say for example Google fonts) in SVGs to allow them to convert to PDFs on the server with the correct rendering of the font?

I realise convert to curves before it hits the svg/pdf converter is probably the best way to go - but I don’t think this is achievable as loading the font on the hosting server (node.js - where the editing occurs) doesn’t look like an option - so is there a way of referencing or embedding the font in the SVG itself?

What’s your recommendation here? Like @import in defs/style, or embed font in base64, has any testing been done and solutions/ best practises found?

@MartyBox124

Currently, Aspose.PDF cloud API does not support custom(non-standard) fonts in SVG to PDF conversion. Please share your input SVG and current PDF along with the expected PDF. We will investigate the issue and will suggest a solution accordingly.

SVG to PDF Converter Online API

curl -X PUT "https://api.aspose.cloud/v3.0/pdf/sample_import.pdf/create/svg?srcPath=Temp%2Fsample_import.svg&dstFolder=Temp" 
-H "accept: application/json" 
-H "authorization: Bearer [Access_Token]" 
-H "x-aspose-client: Containerize.Swagger"

Hello!

Thanks loads for getting back to me… I’ve two SVG’s that will render fonts correctly albeit in the browser, one is via an @import tag, the other embeds the font in the SVG itself.

Both approaches work in the browser, neither work in conversion, all should be in the zip file.

svgfonts.zip (810.5 KB)

Any ideas/thoughts/workarounds?!

Thank you so much for looking at this for me.

@MartyBox124

Thanks for sharing the source documents. We have logged an enhancement ticket to support custom(non-standard) fonts in the SVG to PDF conversion. We will keep you updated about the issue resolution progress.