Rank: Member
Groups: Registered
Joined: 6/1/2016(UTC) Posts: 28  Location: Hessen Thanks: 2 times Was thanked: 1 time(s) in 1 post(s)
|
Hi, is there a possibility to extract the Text from a text form field in pdf. I don't need to change the text, but I need to get the text information (chars and boxes) from the attached document (  Document3.zip (17kb) downloaded 20 time(s).). Thanks and best regards
|
|
|
|
|
|
Rank: Member
Groups: Registered
Joined: 6/1/2016(UTC) Posts: 28  Location: Hessen Thanks: 2 times Was thanked: 1 time(s) in 1 post(s)
|
|
|
|
|
|
|
Rank: Administration
Groups: Administrators
Joined: 1/5/2016(UTC) Posts: 1,138
Thanks: 10 times Was thanked: 133 time(s) in 130 post(s)
|
I'm not sure understanding your goals correctly, but
Textbox does not contain the Text object. So you can't extract it. But you can extract the text string from field. Also you can get the bounding rect of that field. If you need extract the bounding box of each character, you can select each character and then get a selection rectangle.
In both cases there is a problem. These techniques does not cover the situation when the text is scrolled inside a textbox
|
|
|
|
|
|
Rank: Member
Groups: Registered
Joined: 6/1/2016(UTC) Posts: 28  Location: Hessen Thanks: 2 times Was thanked: 1 time(s) in 1 post(s)
|
ok, so I checked the PageObjects from the frist page of the uploaded document.
There is only one element in the collection which is an PdfTextObject with an space as text. But when rendering the page I see the text 'That's just a test!'. The Text-Property of the page is empty too.
So how do I get the text string 'That's just a test!' and the coordinates?
|
|
|
|
|
|
Rank: Administration
Groups: Administrators
Joined: 1/5/2016(UTC) Posts: 1,138
Thanks: 10 times Was thanked: 133 time(s) in 130 post(s)
|
Could you please provide this pdf document?
|
|
|
|
|
|
Rank: Member
Groups: Registered
Joined: 6/1/2016(UTC) Posts: 28  Location: Hessen Thanks: 2 times Was thanked: 1 time(s) in 1 post(s)
|
The document is attached to my first post. Originally Posted by: ju1989  the attached document (  Document3.zip (17kb) downloaded 20 time(s).).
|
|
|
|
|
|
Rank: Administration
Groups: Administrators
Joined: 1/5/2016(UTC) Posts: 1,138
Thanks: 10 times Was thanked: 133 time(s) in 130 post(s)
|
Originally Posted by: ju1989  The document is attached to my first post. The document contains one PdfText object that is empty and one AcroForm's field with "That's just a test!" Thus this document contains two separate objects which are not same. So you can get access to the field's text through following property. Code:
var text = pdfViewer1.Document.FormFill.InterForm.Fields[0].Value;
But fields does not contains PdfText objects, so you can't extract them from field. Edited by user Tuesday, November 15, 2016 2:58:48 AM(UTC)
| Reason: Not specified
|
|
|
|
|
|
Rank: Member
Groups: Registered
Joined: 6/1/2016(UTC) Posts: 28  Location: Hessen Thanks: 2 times Was thanked: 1 time(s) in 1 post(s)
|
If I try this with the latest Pdfium.Net SDK the "FormFill" property is null. Is this a special property that's only set by the pdfViewer?
|
|
|
|
|
|
Rank: Administration
Groups: Administrators
Joined: 1/5/2016(UTC) Posts: 1,138
Thanks: 10 times Was thanked: 133 time(s) in 130 post(s)
|
If you do not use PdfViewer, then you should load docment as shown below Code:
var forms = new PdfForms();
var doc = PdfDocument.Load(@"d:\0\test.pdf", forms);
In this case you can get access to interactive forms via forms variable or doc.FormFill property.
|
|
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.
Important Information:
The Patagames Software Support Forum uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close