I have a string value which is pdf data, how can I convert this string into pdf using your product?
Hi,
Our company has very old version(3.9) of Aspose.Pdf so, I can't use this method How to Convert a text file to PDF
What I am working now is
pdf = new Pdf();
buffer = System.Convert.FromBase64String(pdfString);
MemoryStream mStream = new MemoryStream();
mStream.Write(buffer, 0, buffer.Length);
pdf.BindXML(mStream, null); // error
pdf.Save("test.pdf");
But, I got error saying {"Data at the root level is invalid. Line 1, position 1."}
Thanks for help in advance.
Hi,
Thanks for sharing the code snippet.
As per my understanding, you are using XML to PDF conversion feature using BindXML(…) method. Please note that in order to convert an XML file to PDF format, the source/input XML should be in accordance to Document Object Model of Aspose.Pdf.Generator namespace. In case you need to use your existing XML files, you may consider using an XSLT to make it compatible with DOM of Aspose.Pdf.Generator. For further details, please visit
- Introduction to XML Technologies (Generator)
- Aspose.Pdf for .NET Document Object Model (DOM)
- Create a Hello World PDF document through XML and XSLT
We are sorry for this inconvenience.
PS, we still recommend you to please upgrade to latest release of Aspose.Pdf for .NET 8.8.0 as it includes many new features and fixes related to issues reported in earlier versions.