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: Thursday, September 5, 2019 6:13:50 PM(UTC)
 
Hi,

I can not reproduce this on your example

Code:

static void Main(string[] args)
{
    PdfCommon.Initialize();
    var doc = PdfDocument.Load("e:\\0\\4\\macro_GS1.page21.pdf");
    for(int i = 0; i< doc.Pages[0].PageObjects.Count; i++)
    {
        if (!(doc.Pages[0].PageObjects[i] is PdfTextObject))
            continue;

        var txt = (doc.Pages[0].PageObjects[i] as PdfTextObject).TextUnicode;
        if (txt != "Our FX forecasts ")
            continue;
        float w;
        Pdfium.FPDFTextObj_GetSpaceCharWidth(doc.Pages[0].PageObjects[i].Handle, out w);
        Console.WriteLine(w);
    }
}


Code:

0.278
Press any key to continue . . .
sau002 Posted: Wednesday, September 4, 2019 7:43:17 AM(UTC)
 
Hi All,
I am trying to work out a logic to determine when a text should be broken down. I am using the function FPDFTextObj_GetSpaceCharWidth to determine the width of the space character.

This approach generally appears to be work well. However, for some documents, the space width is zero for some of the text blocks. What could cause this?

Example
In the sample document the word "Forecasts" in the table header .

Thanks,
Sau
macro_GS1.page21.zip (256kb) downloaded 17 time(s).