Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Thu Feb 01, 2024 10:36 am

In the Working-with-FDF-and-XFDF-Files tutorial, XFDF is loaded directly from a file:
Code: Select all
//Import XFDF to PDF
//loadedForm.ImportData("ImportXFDF.xfdf", DataFormat.XFdf);

However, I have XFDF retrieved from the database as text/xml. Is it possible to import data directly as a string rather than an .xfdf file? I would prefer to skip the generating of a temp file. I see that it's possible to load a stream object but only as FDF.

nathaniel.lam
 
Posts: 3
Joined: Thu Feb 01, 2024 10:24 am

Fri Feb 02, 2024 3:30 am

Hello,

Thank you for your inquiry.
After investigation, I found that if the domain in your PDF document is not XFA type, it can be filled directly with xml file, but txt file filling is not supported yet. But if the domain is XFA, I'm sorry either txt file or xml file is not supported by us at the moment.
Code: Select all
 loadedForm.ImportData(@"data.xml", DataFormat.Xml);

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1657
Joined: Wed Apr 07, 2021 2:50 am

Fri Feb 02, 2024 7:08 am

I will give that a try, thank you.

nathaniel.lam
 
Posts: 3
Joined: Thu Feb 01, 2024 10:24 am

Fri Feb 02, 2024 9:16 am

Hello,

You're welcome.
Looking forward to your feedback on the test.
Have a great day.

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1657
Joined: Wed Apr 07, 2021 2:50 am

Fri Feb 02, 2024 10:27 am

I have tried the solution you've posted, but it's still attempting to load a file (via filename), instead of an XFDF string. I'll just stick with the temp file approach since this doesn't seem possible.

nathaniel.lam
 
Posts: 3
Joined: Thu Feb 01, 2024 10:24 am

Sun Feb 04, 2024 2:59 am

Hello,

Thank you for your feedback.
At present, the loadedForm.ImportData() method does not accept string data types as inputs. However, we are actively monitoring user experiences and considering enhancements to our software to better serve your needs. Should this method be updated to support string types in the future, we will ensure that you are notified at the earliest opportunity.
We apologize for the inconvenience caused by the limitation you encountered.
If you have any further questions or need assistance with any other aspect, please feel free to let us know.

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1657
Joined: Wed Apr 07, 2021 2:50 am

Return to Spire.PDF