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

Notification

Icon
Error

Options
Go to last post Go to first unread
sau002  
#1 Posted : Saturday, August 17, 2019 7:07:17 AM(UTC)
sau002

Rank: Newbie

Groups: Registered
Joined: 8/17/2019(UTC)
Posts: 6
United Kingdom

Hi All,
I am evaluating Pdfium.Net SDK fora project that involves reading PDF content.

Consider a PDF document with the words
Hello World

I have no problems in getting the individual characters "H","e","l","l",etc. using the function GetCharacter and their physical dimensions using GetCharBox. This has worked very well so far.

I need some way to predict the width of the SPACE character in the context of the text at the location so that I can frame a logic to join "H","e","l","l","o" into a single word "Hello".

My approach
If the gap between "H" and "e" is less than the width of SPACE character for the font then join into "H" and "e" into "He"

Is this possible? Or is some other way to achieve the same.

Thanks,
Sau

Edited by user Saturday, August 17, 2019 7:09:12 AM(UTC)  | Reason: Changed subject to make more sense

Paul Rayman  
#2 Posted : Monday, August 19, 2019 10:41:51 AM(UTC)
Paul Rayman

Rank: Administration

Groups: Administrators
Joined: 1/5/2016(UTC)
Posts: 789

Thanks: 1 times
Was thanked: 98 time(s) in 96 post(s)
FPDFTextObj_GetSpaceCharWidth(textObject.Handle, out space) ?

ahh ... are you using PdfText? In this case, you can use GetText to get the text as a string and divide it into words by spaces

Edited by user Monday, August 19, 2019 10:47:21 AM(UTC)  | Reason: Not specified

sau002  
#3 Posted : Friday, August 30, 2019 9:02:10 AM(UTC)
sau002

Rank: Newbie

Groups: Registered
Joined: 8/17/2019(UTC)
Posts: 6
United Kingdom

This works. Thank you.
Users browsing this topic
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.