Rank: Newbie
Groups: Registered
Joined: 10/15/2020(UTC) Posts: 8 
|
Hi All Hope this is no so wired to you What am trying to do is to to change the font color for the part of the text in a text object The way I am using now is divide the txt obj into 3, is this the right way?
The problem is that new created txt obj are not aligned like the orignal one, I will post my code later
Thanks in advance for your great help
|
|
|
|
Rank: Administration
Groups: Administrators
Joined: 1/5/2016(UTC) Posts: 963
Thanks: 3 times Was thanked: 115 time(s) in 112 post(s)
|
You can do the following: 1.get the coordinates of each individual character in the original object using the PdfTextObject.GetCharRect method; 2. calculate the offset of each character relative to the origin of the text object; 3. create new objects by specifying the offset of each character in the string; Code:byte[] offsets = ...
Pdfium.FPDFTextObj_SetText(textObject.Handle, "your text", ofssets);
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 10/15/2020(UTC) Posts: 8 
|
Hi Paul Really appreciate your great help
get the coordinates of each individual character in the original object using the PdfTextObject.GetCharRect method;
Seems the GetCharRect will not get the right pos for some special char, for example space, '(', any clue? maybe something releated with Matrix?
calculate the offset of each character relative to the origin of the text object;
Are you mean call CalcCharPos? I think the returned result is also releated with Matrix?
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 10/15/2020(UTC) Posts: 8 
|
|
|
|
|
Rank: Administration
Groups: Administrators
Joined: 1/5/2016(UTC) Posts: 963
Thanks: 3 times Was thanked: 115 time(s) in 112 post(s)
|
Pdf Text will not help you with this task. You will not be able to map PdfText to PdfTextObject to remove unnecessary text.
|
|
|
|
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.
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