wwkloo wrote > I am trying to check the underline and overstrike status of characters in > a PDF. > > I heard that underline and overstrike are achieved by graphical objects in > PDF. So I tried to detect the rectangle and line objects first. Based on > their position and the bounding box position of characters, I may be able > to identify which character is underlined and which is overstrike. > [...] > The rectangle here is the page and can be ignored. However, the lines seem > to be a different coordinate system to the page. Any idea. Please help. > [...] > byte[] pageBytes = reader.GetPageContent(pg); > PRTokeniser tokeniser = new PRTokeniser(new > RandomAccessFileOrArray(pageBytes)); > > PRTokeniser.TokType tokenType; > string tokenValue; > while (tokeniser.NextToken()) > { > }
Your mistake is that you think you can simply extract line and rectangle definition operations without taking the context into account. Firstly there may be operators inbetween which change the coordinate system (which most likely irritates you looking at the coordinates); secondly line and rectangle definitions are not only used for drawing such figures but can also serve to trim output to come. E.g. the page-sized rectangle you see most likely either fills the background with white or trims following output to the page area. Furthermore you ignore xobjects completely. I would recommend you use the classes in the parser package as templates and study the PDF specification. Regards, Michael -- View this message in context: http://itext-general.2136553.n4.nabble.com/Problem-is-check-underline-overstrike-status-of-a-character-in-PDF-tp4657914p4657933.html Sent from the iText - General mailing list archive at Nabble.com. ------------------------------------------------------------------------------ Own the Future-Intel® Level Up Game Demo Contest 2013 Rise to greatness in Intel's independent game demo contest. Compete for recognition, cash, and the chance to get your game on Steam. $5K grand prize plus 10 genre and skill prizes. Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d _______________________________________________ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions iText(R) is a registered trademark of 1T3XT BVBA. Many questions posted to this list can (and will) be answered with a reference to the iText book: http://www.itextpdf.com/book/ Please check the keywords list before you ask for examples: http://itextpdf.com/themes/keywords.php