Enquiry about Aspose.pdf for .Net

Hi,

I have the following requirement:

There are preformatted pdf files on the server, i need to create a web service using c#, which can open this pdf and manipulate it ( edit it ) with the recieved parameters, and generate a new pdf at the client. Can Aspose.pdf fulfill my requirement.

Thanks & Regards

Aryan


This message was posted using Page2Forum from Aspose.Form - Aspose.Pdf for .NET and Java

Hello Aryan,

Thanks for considering Aspose.

We have a product named Aspose.Pdf.Kit which can be used to edit already created Pdf files. But before I can assure you that either our product full fills your need, can you please add few lines to your requirement, i.e. what sort of modifications you need to make in the file?

Hi Nayyer,

Thanks for the reply. I went through the Aspose.Pdf.Kit, and saw the demos, but still I am not able to solve my problem, as i am new to this , can you help me in getting a better documentation or manual for usgae of the various methods. My exact requirement is to build a web service in C#, which opena a pdf form and fill the fields with the arguments passed while calling the webservice and as a result the filled pdf should be displayed on the browser of the client.

Thanks

Aryan

Hello Aryan,

Thanks for considering Aspose.

We are currently looking into the details of your requirements, please spare us a little time so that we can communicate to you that either we are in a position to fulfill your requirements right now or we need to suggest some other solution.

Thanks for your patience.

Hi Nayyer,

Thanks for the mail. I have gone through the demos, and my requirement is similar to the demo of formsdemo, but in the code of that there are only methods defined. i cant see where and how the methods are called. Can you please tell me from where those methods are called.

Thanks

Aryan

Dear Aryan,

Please refer to Default.aspx.cs or Default.aspx.vb.

Dear Tommy,

Thanks for the help, now i am able to generate PDF but it is saved in the server, can i send the generated PDF to client browser without saving on server? If yes can you guide me in doing so.

Thanks

Aryan

Hi Aryan,

If you run the "Fill Fields" demo you can see it sends the PDF to client browser. Doesn't it work for you?

Dear Tommy,

I resolved the problem. Thanks for the support. I want to know that can i use the forms designed in adobe livecycle designer 8.0 as the template pdf, because i designed some forms and in the pdf generated i cant see the fields filled while using the sample student.pdf form it is working.

Thanks

Aryan

Dear Aryan,

I think there are some feaures in adobe livecycle designer 8.0 which are not supported by Aspose.Pdf.Kit. We will investigate this issue and reply to you.

Hi Aryan,

Please refer to <A href="https://forum.aspose.com/t/127014</A>. It is about Adobe Designer 7.0 but 8.0 is the same.</P>

Hi Tommy,

I tried form.FlattenAllFields() before form.save(), but still the final generated pdf form fields are empty.

Regards

Aryan

Dear Aryan,

Please provide your PDF template and code. We will test it and reply to you soon.

Hi Tommy,

Please find attached the PDF Template i generated in adobe lifecycle designer 8.0 and here is the code

Random RandomClass = new Random();
int num = RandomClass.Next(1, 100);
string templatePdf;
string output = "mynew" + num;
string Mydir = "C://Manish/";
templatePdf = Mydir + doc_type + ".pdf";


Form form = new Form(templatePdf, Mydir + output + ".pdf");
//Fill the field "Name" with "Mike".
form.FillField("Name", name);
//Choose the field "Gender" with "Male".
form.FillField("Gender", "Male");
//Fill the field "Telephone".
form.FillField("Telephone", tel);
//Fill the field "Address".
form.FillField("Address", address);
//Choose the item "GradeTwo" of the Combo field "Grade".
form.FillField("Grade", "GradeTwo");

//use case for checking the checkbox "Lodging".
//form.FillField("Lodging","Yes");
//use case for unchecking the checkbox "Lodging".
//form.FillField("Lodging", "Off");
//Fill the image button field.
//form.FillImageField("Photo", path + @".\Resources\lovely.jpg");

form.FlattenAllFields();
form.Save();
HttpResponse Response = Context.Response;
Response.ContentType = "application/pdf";
Response.WriteFile(Mydir + output + ".pdf");

Response.End();

i am using visual studio 2008

Hello Aryan,

I have tested the code and i was able to save the the filled form. Infact i made a little change in the code.

Aspose.Pdf.Kit.Form form = new Aspose.Pdf.Kit.Form("C://Temp//absTableHTML//studenti.pdf","C://Temp//absTableHTML//student_2.pdf");

form.FillField("Name", "Nayyer");

//Choose the field "Gender" with "Male".
form.FillField("Gender", "Male");

//Fill the field "Telephone".
form.FillField("Telephone", "001325433435");

//Fill the field "Address".
form.FillField("Address", "House # 1084, Street 110");

//Choose the item "GradeTwo" of the Combo field "Grade".
form.FillField("Grade", "GradeTwo");

//use case for checking the checkbox "Lodging".
form.FillField("Lodging","Yes");

//Fill the image button field.
form.FillImageField("Photo", @"C:\\Temp\\Aspose.JPG");

form.FlattenAllFields();
form.Save();

The output pdf is also in attachment.

Hello Nayyer,

I am not able to see any changes in the code except

Aspose.Pdf.Kit.Form form = new Aspose.Pdf.Kit.Form(templatePdf, Mydir + output + ".pdf");

I tried with this line also, but still in the generated pdf fields are blank. Did u tried it with evaluation version?

Regards

Aryan

I tried your code with the form studenti.pdf , it is generating student_2.pdf but still in the student_2 fields are not filled.

Aryan

Hi

I also noticed one thing, the file student_2 generated by me is of size 50.7kb , while the file student_2 which u send as attachment is of size 39.7kb

Aryan

Dear aryan,

Thanks for considering Aspose.Pdf.Kit.

As I explained in <A href="https://forum.aspose.com/t/127014</A>, in Kit 3.0.0.0 Form.FillField() only works with valid license. A good news is that we have open the function to unlicensing users from the next coming version, which will be released before the end of this month. But before that, we can provide you a trail version in advance if you need it so urgently.</P> <P>Best regards.</P>