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

Notification

Icon
Error

Post a reply
From:
Message:

Maximum number of characters in each post is: 32767
Bold Italic Underline   Highlight Quote Choose Language for Syntax Highlighting Insert Image Insert an existing Attachment or upload a new File... Create Link   Unordered List Ordered List   Left Justify Center Justify Right Justify   Outdent Indent   More BBCode Tags
Font Color Font Size
Security Image:
Enter The Letters From The Security Image:
  Preview Post Cancel

Last 10 Posts (In reverse order)
Paul Rayman Posted: Monday, November 2, 2020 11:26:27 PM(UTC)
 
Pdf Text will not help you with this task. You will not be able to map PdfText to PdfTextObject to remove unnecessary text.
lugangxyz Posted: Thursday, October 29, 2020 3:37:35 PM(UTC)
 
Hi Paul
Just found a similar link :
https://forum.patagames....ight-and-Char-Rectangles

In the thread above you suggestion use PdfText, could you please share some examples of using PdfText instead of PdfTextObject?
Thanks in advance
lugangxyz Posted: Thursday, October 29, 2020 7:10:48 AM(UTC)
 
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?




Paul Rayman Posted: Tuesday, October 27, 2020 7:13:16 PM(UTC)
 
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);
lugangxyz Posted: Tuesday, October 27, 2020 3:47:40 PM(UTC)
 
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