Free Support Forum - aspose.com

Import export xml to pdf

Hi,

I was checking your samples about how to import an xml file to a pdf file. Till now is very helpful.

My application is stored on a server and the user interacts with it from a local pc.

I want to import an xml file(that is on a server directory) to the pdf(that is also on a server directory). The user then will make some modifications, maybe he will correct the data inside the pdf and he will have to save the modifications.(export the data to an xml file or an aspx page).

Do you support the above scenario? From the examples i checked out there is no way to save modifiactions that are done to a pdf back to the server.

Regards,

Eleni

Hi Eleni,

In order to import the XML data into a PDF file or export the data to an XML file, both the files must be on the server side. So, I would suggest you to send the updated data to the server before processing it with Aspose.Pdf.Kit, and this needs to be done by your application.

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

Hi,

thanks for the answers.

How can i send the data that are inside the pdf to the server? Do i have to use a button inside the pdf? How should i retrieve the value of the fields server-side?

Regards,

Eleni

Hi Eleni,

If you’re interested to post the PDF form data to the server, you can add a submit button inside the PDF using Aspose.Pdf.Kit. You can also retrieve the form’s values in a web page. Please read the following article:

Posting AcroForm data to an external web page

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

Hi,

As i understand we have an input.pdf with the values and we create acrofields in the form of the input pdf. How can i know the position of the fields in order to set it inside the code?

Regards,

Eleni

Hi Eleni,

I’m afraid, I couldn’t understand your question. Why would you need the position of the fields in this scenario? You already have the fields in the PDF file. You can add a submit button, and you’ll post the data to a web page. On the web page, you can retrieve values just as you would do for a web form.

Please elaborate your question, so I would be able to help you out.
We’re sorry for the inconvenience.
Regards,

Hi,

In the url you posted me there is a section where it says editor.AddFields(....).

I take the input pdf, i add the fields and the submit button and i take the output pdf.

Is that correct?

When i call the addfields i should set the position of the fields isn't that correct?

Hi Eleni,

If you mean X and Y coordinates and the width and height of the controls, then yes, you need to supply those parameters while adding a control. However, while adding a control you’ll have to specify these values explicitly, depending upon where in the PDF file you’re going to add these fields. If you’re interested to add a new field relative to the position of an existing field then you can get the coordinates of the existing field using the following code snippet and then place the new object at some relative position.

//read input file
Aspose.Pdf.Kit.Form form1 = new Aspose.Pdf.Kit.Form("input.pdf");
//read field's facade value
FormFieldFacade facade = form1.GetFieldFacade("text1");
//get coordinates and the height and width of the control
System.Drawing.Rectangle rec = facade.Box;




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

Hi,

I have created a pdf file from an xml file that contains greek data.

1)When i open the pdf with the imported greek data, the greek characters are not displayed at all.

2)The pdf file contains a submit button. When i hit the submit button inorder to get the pdf fields the greek caracters are not recognizable.

What do you suggest?

Hi Eleni,

This issue is already logged as PDFKITNET-11115 in our issue tracking system. Our team is looking into this and you’ll be updated as the issue is resolved. You can follow up this issue on the following post of yours:

Import greek letters in aspose pdf

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