Generate PDF document from XML template

Hello,

I’m evaluating your Pdf.Kit library for .NET, wanting to use the XML import functionality. I have, however run into some problems while trying to import the XML data.

I’m getting the following exception thrown in the call to ImportXml,
Unhandled Exception: The ‘]’ character, hexadecimal value 0x5D, cannot be includ
ed in a name.

The code I’m using is pretty straight forward, I’ve basically just pulled the code from the example in your documentation.

Form form = new Form(@“C:\updated_IDS.pdf”, @“C:\aspose.pdf”);

using (FileStream xmlInputStream = new FileStream(@“c:\updated_IDS_data.xml”, FileMode.Open))
{
form.ImportXml(xmlInputStream);
form.Save();
xmlInputStream.Close();
}
Why do I get this error? Is there anything to be done that can fix it? I have no control over the target pdf file.

Adobe Reader can import the file just fine. It’s the content of the us-patent-cite that makes it crash. The Xml file is created with Aspose.Pdf.Kit:s ExportXml functionality from another copy of the same PDF file except it is filled with data.

I have attached the files to the post.

Yours sincerely,
Fredrik

Hi Fredrik,

We’re looking into this issue at our end and you’ll be updated with the status the earliest possible.

We’re sorry for the inconvenience.
Regards,

Hi Fredrik,

I have tested this issue at my end using the latest version (5.1.0) and imported the data successfully. I used the code snippet and the input PDF and XML files you shared in your post. Please download the latest version and try at your end. If you still find any issue then please do let us know.

We’re sorry for the inconvenience.
Regards,

Hi Shahzad,

Thank you for your help. I downloaded the 5.1.0 version (I was running 5.0.0) and the run-time error is fixed.

However when I open the resulting PDF file in Acrobat Reader I get an alert saying "This document enabled extended features in Adobe Reader. The document has been changed since it was created and use of extended features is no longer available. Please contact the author for the original vesion of this document."

Also, the number of rows in the table U.S.PATENTS is correct but no values seem to be imported to them.

Is it possible to work around this somehow? Any help I can get is much appreciated.

Thank you,

Hi Fredrik,

I have logged both of these issues in our issue tracking system for further investigation. Our team will look into these issues and you’ll be updated via this forum thread once they’re resolved. The issue IDs are as given below:

PDFKITNET-22442 - Issue with extended features
PDFKITNET-22443 - Issue with filling data rows

We’re sorry for the inconvenience.
Regards,