We are having an issue converting a text note to a PDF using Aspose PDF 23.1.1 for .net, but it doesn’t happen often - maybe one in 10 or 20 conversions.
A pdf is built, and written to a memory stream. Every dozen or so times, the code never returns from the Save, the CPU spikes and eventually Aspose uses up all the memory on the server.
During my investigation, I saved the PDF as an XML file, and then read it back in again to see if that might change the behaviour. It did not, but I could reproduce the issue using the XML file that was not converting.
I wrote a simple app to read in the XML document as a PDF, and save it to a memory stream.
My code to do this is,
License license = new License();
license.SetLicense("Aspose.PDF.NET.lic");
Document doc = new Document();
doc.BindXml("C:\\temp\\doc.xml");
MemoryStream ms = new MemoryStream();
doc.Save(ms);
return;
I’ve attached the XML document I’ve been using.
doc.7z (1.4 KB)