I can Iterate through the first lines to get the "chapters" and "subchapters" in order (after the headline):
Signal Path 1
- Measurement 1
Signal Path 2
- Measurement 2
- Measurement 3
- Measurement 4
Thats easy.
After that I can find each text-sequence in the content of the pdf and set a bookmark, works fine.
But in some cases I have to find a particulary result or graphic name, to lead the bookmark direct to the result or graphic, not only to the headline of the measurement.
The problem is, the names of these results are dynamicly and I have no chance to read it out first.
These names are in my example:
Result or Graphic 1
Result or Graphic 2
Result or Graphic 3
Result 4
All of these targets are backcolored with the same grey.
And now my quesiton:
Can I find a property background color in the PdfTextFragment List?
I split a page by \n\l in to lines and iterate throug each line or search a text fragment in the whole page.
like this:
- Code: Select all
PdfTextFinder pdfTextFinder = new PdfTextFinder(pdfDoc.Pages[seite]);
pdfTextFinder.Options = pTFO;
pdfTExtFragment foundList = pdfTextFinder.Find(findWord);
..
if(foundList[0].LineText.Trim() == "XYZ") ===> && foundList[0].BackgroundColor = Grey
...
And what I want is, to get the background Color of the Segment to select the difference to the other lines.
like this: ===> && foundList[0].BackgroundColor = Grey (or .HighLite = Grey)
The source code from the original html text looks like:
- Code: Select all
<span style="position:absolute;top:0.6597221in;left:0.01388884in;width:6.472222in;height:0.1597222in;font-family:Arial;font-size:10pt;color:#000000;vertical-align:top;background-color:LightGrey;"><nobr>NoiseRMS 90k : Signal Path Setup</nobr></span>
I dont know, how spire the background translate, maybe into highlite?
Is there a background color poroerty for a text fragemnt or is this only the highlite style in PDF?