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

Free Support Forum - aspose.com

How can aspose.pdf or aspose.pdf.kit help to solve this scenario?

Hello Aspose Pdf,
I found Aspose pdf documnetation better then other competing pdf libraries. I am evaluating Aspose’s pdf library if it can fit into our requirement.

1. On Server: Create a Pdf Document from a xml document. Xml document is not the specification of pdf doc but representing an artifact. The generated pdf’s data section (say Table) sizee will vary depending on the content of xml. The schema of xml is known.
2. On Server: Plus in the generated pdf’s table there will be pdf form as well so for each row of the table, user can provide some input.

3. Client: User is presented such PDF and she/he fills all form value offline.
4. Client: User is done and now he comes online and want to upload the data to server.
Challenge is to upload the data entered into form field on to server. How can we achieve this without providing any extra utility at client side. user have all is pdf.

Can we embed java script in pdf so once pdf form is filled and user click some submit button , java script saves form data into some other file format which latter can be uploaded to server ?
Or if server is up then data can be directly send to the server.
Please provide some details here.

Thanks
-|- pchandor

Hello Pramod,

Thanks for considering Aspose.

Aspose.Pdf is a component which is used to generate PDF documents from scratch. It also offers the feature to generate the PDF files using XML documents, but the input XML must be in Aspose.Pdf compatible format. In case the file in not in compatible format, then you can use XSLT to make it compatible with Aspose.Pdf. For more related information, please visit Introduction to XML Technologies and also check Create a Hello World PDF document through XML

As per your requirements, you can add tables as well as Form fields to the PDF document. For more information, please visit Working with Tables and Manipulating Form Fields

Please don't forget to visit the following link for better understanding on Aspose.Pdf for .NET Document Object Model (DOM)

Regarding requirement 3 and 4, I think you need to use Aspose.Pdf.Kit which is used to manipulate/edit any existing PDF documents. For your convenience, I am moving this thread to Aspose.Pdf.Kit forum where I believe our team of experts taking care of that product would be in better position to answer these queries.

In case I have not properly understood your requirement on creating PDF document or you have any further query, please feel free to contact.

Thanks Nayyer for the response.
I am looking forward for the #3 and #4’s answer. Since #3 and #4 steps to be performed at client machine, I need to know if there is any way to embed scripting capability inside pdf to fulfill those required actions

Hi Pramod,

As far as your requirement related to sending the PDF form data to server is concerned, I would like to share that Aspose.Pdf.Kit for .NET allows you to set a submit URL for a submit button in a PDF file. When you submit the PDF form, the values in the PDF form fields are posted to the server and can be received on the server side, using a web page, just like the values are received from a web form.

I hope this helps. If you have any further questions, please do let us know.
Regards,

Hi Shahzad,
As you said “Aspose.Pdf.Kit for .NET allows you to set a submit URL for a submit button in a PDF file"
Is this also available in
Aspose.Pdf.Kit for Java”?

Secondly instead of submitting it to the server, is it possible to export form data into some other format when client has gone into offline mode, which can be uploaded to the server, when client is again in the network. I am guessing java script in pdf can play key role here.

Thanks for response
-|- pchandor

Hi Pramod,

I’m sorry for this confusion. In fact, I meant to say Aspose.Pdf.Kit for Java. As you might have noticed the mentioned link points to the Java documentation.

Regarding your second requirement, I would like to share that you will have to build a client side application which will allow you to export the PDF data to XML, FDF or XFDF formats as mentioned in the following link:


Other than that, there is no way PDF itself can export the data to some format. So, if you don’t want to go into building a client side application and just want the users to post the data to the server then my previous suggestion would be helpful. If both of these options do not work for you then I’m afraid your users will have to upload the PDF file itself to the server and then you can export that data to your required format.

I hope this helps. If you have any further questions, please do let us know.
Regards,

ExportToXml() exports contents of the form fields. I am wondering how those field values are exported.
is it something default value for those fields exported into xml?

Lets say I open pdf form in acrobat reader, fill in the form fields and print it as pdf using some pdf printer.
Can aspose extract form data from such pdf?

Hi Pramod,

The exportToXml method exports currently filled values to the XML. As far as extracting values from a printed PDF file is concerned, you can try to test such a file at your end. However, if it doesn’t work then please share a sample PDF file with us so we could test it at our end.

If you have any further questions, please do let us know.
Regards,

Hi
I tried extracting form data from attached pdf, but api call had null pointer exception
java.lang.NullPointerException
at com.aspose.pdf.kit.Form.exportXml(Unknown Source)
at samples.form.Export2XML.main(Export2XML.java:30)
java.lang.NullPointerException

regards

Hi Pramod,

We’re investigating this issue at our end and you’ll be updated with the results the earliest possible.

We’re sorry for the inconvenience.
Regards,

Hi Pramod,

I have tested this issue at my end and noticed the same exception; however, the problem is that you’re using a flattened PDF file to export the data to XML. Please try to use the original and editable PDF file to export the data to XML. If you still find the same problem with the editable PDF file then please share that file with us, so we could test the issue at our end.

We’re sorry for the inconvenience.
Regards,