sal salaimani wrote:
> I am looking for implementation logic or algorithm to parse path
> object(graphics object) from a PDF file. As we all aware , iText API does
> not have the capability to parse path object ,

Yes it has.
Look at chapter 15 of the second edition of "iText in Action",
or at the source of the parser package.

> I pursued to review PDFbox
> and multivalent APIs to grasp the implementation logic to parse path object.
> I could not find any implementation for parsing path object in these APIS. I
> am stuck now.  All I am looking for is where path object starts and where it
> ends as marked content operators BDC...EMC..inline image...BI EI ...image
> with Do operators.  The path object has too many operators.

Granted,
the focus of the parser in iText is to find images and text
(see the classes TextRenderInfo and ImageRenderInfo), but
there's already some support for marked content (BDC/EMC) and
inline images (BI/EI).

>  For example, a
> chart in a PDF doc has many pathing and graphics operators mix as below. 
> Instead of parsing each and every pathing and graphics operators and
> identify as rectangle or line and group them as chart, I want to implement
> simple logic to find where path obj starts and ends. I really appreciate if
> anyone points me to right direction.
> 
> TOTAL NO OF PAGES = 1
> content stream for page 1 =BT
> /GS0 gs
> /TT0 1 Tf
> 0.0009 Tc -0.0021 Tw 12 0 0 12 90 708.96 Tm
> [(This is a cha)5(r)-1(t  )]TJ
> 0 Tc 0 Tw 0 -1.15 TD
> ( )Tj
> T*
> ( )Tj
> ET
> q
> 1 0 0 1 121.8000031 562.6799927 cm
> 0.5 g
> 0 0 m
> 2.4 1.8 l
> 126 1.8 l
> 123.6 0 l
> 0 0 l
> f*
> Q
> q
> 1 0 0 1 121.8000031 562.6799927 cm
> 0.754 g
> 0 0 m
> 0 96.6 l
> 2.4 98.4 l
> 2.4 1.8 l
> 0 0 l
> f*
> Q

I think it's feasible to extend the available parser
functionality. In the book, there's an example that
draws a rectangle that contains all the text on a page.

There is no such functionality (yet) to get the bounding
rectangle of a shape, but it should be doable with some
extra programming work.
-- 
This answer is provided by 1T3XT BVBA
http://www.1t3xt.com/ - http://www.1t3xt.info

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.itextpdf.com/book/
Check the site with examples before you ask questions: 
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/

Reply via email to