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

Notification

Icon
Error

New Topic Post Reply
Options
Go to last post Go to first unread
sau002  
#1 Posted : Saturday, August 17, 2019 4:07:17 AM(UTC)
Quote
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 4:09:12 AM(UTC)  | Reason: Changed subject to make more sense

Paul Rayman  
#2 Posted : Monday, August 19, 2019 7:41:51 AM(UTC)
Quote
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)
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 7:47:21 AM(UTC)  | Reason: Not specified

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

Rank: Newbie

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

This works. Thank you.
Quick Reply Show Quick Reply
Users browsing this topic
Guest (4)
New Topic Post Reply
Forum Jump  
You can post new topics in this forum.
You can reply to topics in this forum.
You can delete your posts in this forum.
You can edit your posts in this forum.
You cannot create polls in this forum.
You can vote in polls in this forum.