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.

Wed Jul 27, 2016 12:30 pm

Hi All,

Can we read form fields from PDF using Spire.PDF. If it is possible, can someone provide me with a sample with C#?

Thanks in advanced. Much appreciated

ipandya
 
Posts: 5
Joined: Wed Jul 27, 2016 12:24 pm

Thu Jul 28, 2016 3:23 am

Dear ipandya,

Thanks for your inquiry.
Spire.PDF supports to extract form field. Here is sample code for your reference:
Code: Select all
            PdfDocument doc = new PdfDocument();
            doc.LoadFromFile(FilePath + "FormFieldData.pdf");
            //Get form
            PdfFormWidget formWidget = doc.Form as PdfFormWidget;
            for (int i = 0; i < formWidget.FieldsWidget.List.Count; i++)
            {
                PdfField field = formWidget.FieldsWidget.List[i] as PdfField;
                if (field is PdfTextBoxFieldWidget)
                {
                    PdfTextBoxFieldWidget textBoxField = field as PdfTextBoxFieldWidget;
                    //Get the text
                    string s =textBoxField.Text;
                   ...
                }
            }

Also, there is a guide to fill Form Fields for your reference.
http://www.e-iceblue.com/Tutorials/Spir ... ith-C.html
If there is any question, welcome to get it back to us.

Sincerely,
Betsy
E-iceblue support team
User avatar

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

Fri Jul 29, 2016 4:43 pm

Hi Betsy,

Thank you for your response. We are evaluating your SDK and would like to know that, if it is possible to extract text from a given area (rectangle). If yes, could you just provide me with a sample or the name of the section which has to be searched in the help file for me to get started. I need this urgently and our organization is stuck in the purchase of the SDK.

Thanks in advance. I hope you understand the importance of situation.

Regards,
Ishan P

ipandya
 
Posts: 5
Joined: Wed Jul 27, 2016 12:24 pm

Mon Aug 01, 2016 1:45 am

Dear Ishan P,

Sorry for late reply as weekend.
Sorry that there is no way to extract text from a given area (rectangle).

Sincerely,
Betsy
E-iceblue support team
User avatar

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

Thu Aug 04, 2016 5:42 am

Hi Betsy,

Thank you for your response.

I would like to know one more thing, I would like to remove encryption from a PDF, please find below sample code for the removal of encryption:


Code: Select all
PdfDocument doc = new PdfDocument();
pdfDoc.Security.OwnerPassword = "";
pdfDoc.Security.UserPassword = "";
pdfDoc.Security.Permissions = PdfPermissionsFlags.AccessibilityCopyContent | PdfPermissionsFlags.AssembleDocument | PdfPermissionsFlags.CopyContent | PdfPermissionsFlags.Default | PdfPermissionsFlags.EditAnnotations | PdfPermissionsFlags.EditContent | PdfPermissionsFlags.FillFields | PdfPermissionsFlags.FullQualityPrint | PdfPermissionsFlags.Print;

pdfDoc.SaveToFile(outputFile.OutPutFilePath);
pdfDoc.Close();


My problem here is that the file does not remove encryption level when I remove the password(Attached screen shot for the same). Is there any other way to remove the owner and user password as well as encryption levels?

Thanks in advance.

Regards,
Ishan Pandya

ipandya
 
Posts: 5
Joined: Wed Jul 27, 2016 12:24 pm

Thu Aug 04, 2016 6:38 am

Dear Ishan,

Thanks for your feedback.
Please try to only set the PdfPermissionsFlags as Default, here is sample code for your reference:
Code: Select all
            doc.Security.OwnerPassword = "";
            doc.Security.UserPassword = "";
            doc.Security.Permissions = PdfPermissionsFlags.Default;

If this issue still exists, please provide us your sample document for investigation.

Sincerely,
Betsy
E-iceblue support team
User avatar

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

Thu Aug 04, 2016 10:04 am

Hi Betsy,

Thank you for your help. It worked. Much appreciated.


Regards,
Ishan P.

ipandya
 
Posts: 5
Joined: Wed Jul 27, 2016 12:24 pm

Fri Aug 05, 2016 1:17 am

Dear Ishan,

Thanks for your feedback.
Welcome to write to us again for further question.

Sincerely,
Betsy
E-iceblue support team
User avatar

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

Fri Aug 05, 2016 2:32 pm

Hi Betsy,

I have one more request for you. Your help is much appriciated.

I have a raster PDF and I am trying to convert it to image. This PDF contains only images on the Pages. However, when I try to perform the operation the execution does not complete and exit the API call of "SaveAsImage". Can you help me with this?

Regards,
Ishan P

ipandya
 
Posts: 5
Joined: Wed Jul 27, 2016 12:24 pm

Mon Aug 08, 2016 1:54 am

Dear Ishan,

Sorry for late reply as weekend.
Could you please provide us the sample file and the codes you were using ? That would be very helpful to investigate this issue.
Also, please describe your issue in detail.

Thanks,
Betsy
E-iceblue support team
User avatar

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

Return to Spire.PDF

cron