We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

"Parameter not valid" when convert HTML with inline SVG to PDF

I’m trying to convert HTML with inline SVG to PDF. The inline SVG is inserted as an image and a base64 string:

<img src="data:image/svg+xml;base64,PHN2ZyB4bWxu....">

However, I keep getting the following error when saving the document:

“Exception”:"System.ArgumentException: Parameter is not valid. at System.Drawing.Graphics.set_Transform(Matrix value)

I’ve tried to use the CustomLoaderOfExternalResources to load the SVG manually; first by removing “data:image/svg+xml;base64,” from the src and then converting the base64 string to a byte array and then returned the ResourceLoadingResult, like so:

new Aspose.Pdf.LoadOptions.ResourceLoadingResult(resultBytes)
     // Set MIME Type
     MIMETypeIfKnown = "image/svg+xml"

Is there any way to make inline SVG as image work? This error only appears on a Linux server. The code works perfectly locally on my Windows machine. Btw, I’m using Aspose.PDF 21.10.1


Could you please make sure that libgdiplus package is installed and updated in your system? Also, please try to install msttcorefonts package. In case you still notice any issue, please share complete HTML with us in .zip format so that we can further proceed to assist you accordingly.

The libgdiplus and msttcorefonts packages are both installed on the server.
Here’s the complete HTML in a .zip file:
html.zip (439 Bytes)


We have logged an investigation ticket as PDFNET-50873 in our issue tracking system to further analyze this case. We will look into its details and keep you posted with the status of its correction. Please be patient and spare us some time.

We are sorry for the inconvenience.