Hi again!
I have a question strictly connected with making AcroForms. Is there a possible way to read a html form(i have it at server) and convert it into an acroform?
Next one - is there a possibility to edit normal pdf to make it acroform? For example I have pdf in which the first page is with name, surname and age boxes, and then I want to make an interactive box from each of them. I am asking, because now I'm trying do do it, I have web service with html to pdf converter, I load a .pdf file (htmltoPdf) and then open it with PdfLoadedDocument. Is it possible in this way?
MJ
And another thing - I've got an exception in:
PdfLoadedDocument loadedDoc = new PdfLoadedDocument(filename);
loadedDoc.CreateForm();
PdfPageBase page = loadedDoc.Pages.Add();
HERE: (Object reference not set to an instance of an object.)
PdfButtonField bt = new PdfButtonField(page, "Submit");
bt.Bounds = new RectangleF(0, 0, 100, 100);
bt.Text = "Submit";
loadedDoc.Form.Fields.Add(bt);
What am I doing wrong?
MJ
Here is a null exception:
PdfButtonField
bt = new PdfButtonField(page2, "Submit");Why?
Ok, I have already managed to solve it. We have to create this PdfPageBase page, and then add PdfPage value to it.
Hi Maciej,
Thank you for using Syncfusion products.
We have created a sample to convert the Html form to PDF form by using the web Browser control. At first we have to convert the Html file into PDF document, then load the PDF document and add the form fields in the respective co-ordinates taken from the html file using IHTMLInputElement. Please find the sample available in the link below,
Please let us know if you have any questions.
Regards,
George
Ok, thanks.
Now I have a second problem connected with:
if (obj is IHTMLInputElement)
{
IHTMLInputElement element = obj as IHTMLInputElement;
IHTMLElement textElement = obj as IHTMLElement;
RectangleF linkBounds = new RectangleF();
linkBounds = GetBounds(textElement, false);
PdfTextBoxField newfield = new PdfTextBoxField(lDoc.Pages[0] as PdfPageBase, element.name);
newfield.Bounds = linkBounds;
lDoc.Form.Fields.Add(newfield);
}
I have a null exception in this line(only with my form, because with it works well with yours):
PdfTextBoxField newfield = new PdfTextBoxField(lDoc.Pages[0] as PdfPageBase, element.name);
Why is it null? I changed a path to my html form, in this form I have a lot of controls.
Second question - is it possible to add radioboxes and another controls, such as it is possible in normal form filling?
Ok, the problem has been solved