logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
ju1989  
#1 Posted : Thursday, October 27, 2016 2:00:46 AM(UTC)
ju1989

Rank: Member

Groups: Registered
Joined: 6/1/2016(UTC)
Posts: 28
Germany
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
ju1989  
#2 Posted : Friday, November 11, 2016 12:45:06 AM(UTC)
ju1989

Rank: Member

Groups: Registered
Joined: 6/1/2016(UTC)
Posts: 28
Germany
Location: Hessen

Thanks: 2 times
Was thanked: 1 time(s) in 1 post(s)
Is there any solution?
Paul Rayman  
#3 Posted : Friday, November 11, 2016 5:04:51 PM(UTC)
Paul Rayman

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
ju1989  
#4 Posted : Monday, November 14, 2016 5:55:02 AM(UTC)
ju1989

Rank: Member

Groups: Registered
Joined: 6/1/2016(UTC)
Posts: 28
Germany
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?
Paul Rayman  
#5 Posted : Monday, November 14, 2016 2:38:25 PM(UTC)
Paul Rayman

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?
ju1989  
#6 Posted : Monday, November 14, 2016 11:56:12 PM(UTC)
ju1989

Rank: Member

Groups: Registered
Joined: 6/1/2016(UTC)
Posts: 28
Germany
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 Go to Quoted Post
the attached document ( Document3.zip (17kb) downloaded 20 time(s).).


Paul Rayman  
#7 Posted : Tuesday, November 15, 2016 2:54:21 AM(UTC)
Paul Rayman

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 Go to Quoted Post
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

ju1989  
#8 Posted : Tuesday, November 15, 2016 3:12:33 AM(UTC)
ju1989

Rank: Member

Groups: Registered
Joined: 6/1/2016(UTC)
Posts: 28
Germany
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?
Paul Rayman  
#9 Posted : Tuesday, November 15, 2016 4:13:57 AM(UTC)
Paul Rayman

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.
Users browsing this topic
Guest
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.