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.

Fri Mar 20, 2015 4:06 pm

Code: Select all
var pdf = new PdfDocument(source);
pdf.Form.Fields.Add(textField); // throws null reference


How do I create new form with fields for existing pdf in Spire.PDF?

jekasta
 
Posts: 1
Joined: Tue Sep 11, 2012 7:40 pm

Mon Mar 23, 2015 8:08 am

Hello,

Thanks for your inquiry.
The Spire.PDF can support the feature of creating new form with fields for existing pdf which has form fields. If the pdf-file doesn’t have form field, the Spire.PDF doesn’t support the feature of creating new form with fields at present, and we have added this new feature into our schedule. Once there are any processes, we will inform you immediately.

Best Regards,
Betsy
E-iceblue support team
User avatar

Betsy
 
Posts: 802
Joined: Mon Jan 19, 2015 6:14 am

Thu Apr 02, 2015 8:43 am

Hello,

Now the new feature has added into the newest hotfix of Spire.PDF, which has been released. Please download the Spire. PDF Pack(Hot Fix) version:3.2.165 from the following link and refer to the codes provided to have a try:
http://www.e-iceblue.com/Download/downl ... t-now.html

Codes:
Code: Select all
PdfDocument loDoc = new PdfDocument();
loDoc.LoadFromFile("file.pdf");
if (loDoc.Form == null)
{
   loDoc.AllowCreateForm = true;
}
PdfPageBase loPage = loDoc.Pages[0];
PdfTextBoxField loField = new PdfTextBoxField(loPage, "kkk");
loField.Bounds = new RectangleF(100, 100, 20, 10);
loField.BorderWidth = 0.75f;
loField.BorderStyle = PdfBorderStyle.Soild;
loField.Required = true;
loDoc.Form.Fields.Add(loField);
loDoc.SaveToFile("qqq.pdf");

If there are any questions, welcome to get it back to us.
User avatar

Betsy
 
Posts: 802
Joined: Mon Jan 19, 2015 6:14 am

Fri Apr 03, 2015 7:15 am

Hello,

Have you tried the new feature? Has it fulfilled your needs? Could you please give us some feedback?

Thanks,
Betsy
E-iceblue support team
User avatar

Betsy
 
Posts: 802
Joined: Mon Jan 19, 2015 6:14 am

Thu Sep 01, 2016 4:20 pm

Why isn't this feature part of the latest?

I even see several sample pages with the fabled PdfDocument.AllowCreateForm

With the latest version, object explorer search for AllowCreateForm results in nothing, and I can't find a link to the old "hotfix version" you refer to here. Is there some kind of ubiquitous thing that I'm unaware of?

I have a PDF that lacks an acroform (form property is null after loading it) that I need to add fields/field data to.

matt54321
 
Posts: 2
Joined: Thu Sep 01, 2016 3:56 pm

Fri Sep 02, 2016 4:03 am

Dear matt54321,

Thanks for your inquiry.
I suppose you were using Free version, sorry that it doesn't have the property AllowCreateForm, it is only supported in commercial version. Please try to use latest Spire.PDF Pack(Hot Fix) Version:3.7.198, it has the property.
If there is any question, welcome to get it back to us.

Thanks,
Betsy
E-iceblue support team
User avatar

Betsy
 
Posts: 802
Joined: Mon Jan 19, 2015 6:14 am

Wed Sep 07, 2016 8:23 am

Dear matt54321,

Did you test the hotfix I mentioned ? Has the issue been resolved ?

Thanks,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Fri Sep 09, 2016 11:52 am

talk about dismembering the free version to prop up the paid

anyway, since we only needed to distribute the template I stamped the PDF using iTextSharp, and will be distributing PDFsharp to fill it with.

matt54321
 
Posts: 2
Joined: Thu Sep 01, 2016 3:56 pm

Mon Sep 03, 2018 12:58 pm

Hi,

Is "AllowCreateForm" feature part of the latest free version?
I must test it before I can recommend to buy the commercial version.

Thanks and best regards

dilind
 
Posts: 1
Joined: Mon Sep 03, 2018 7:58 am

Tue Sep 04, 2018 1:51 am

Hello Samindra,

Thanks for your inquiry.
Sorry that we have no plan to maintain the free version at present, the property "AllowCreateForm" is only supported in our commercial version( at present the latest one on website is Spire.PDF Pack(Hot Fix) Version:4.8.14). In addition, to help you better evaluate our product, our sales team just sent a temporary(one month free) license of Spire.PDF to your email. You could apply the license by license key to remove the warning message. If there is any doubt, just feel free to contact us.

Sincerely,
Lisa
E-iceblue support team
Last edited by Lisa.Li on Wed Sep 05, 2018 10:42 am, edited 1 time in total.
User avatar

Lisa.Li
 
Posts: 1261
Joined: Wed Apr 25, 2018 3:20 am

Wed Sep 05, 2018 9:22 am

Hello Samindra,

Greetings from E-iceblue.
Did the commercial version work for you? I would appreciate that if you could give some feedback. Thanks in advance.

Sincerely,
Lisa
E-iceblue support team
User avatar

Lisa.Li
 
Posts: 1261
Joined: Wed Apr 25, 2018 3:20 am

Return to Spire.PDF