hi erik,

i haven't had time to look into your script but i think the requested 
functionality is implemented in 
dialogs.qs in function highlightingSelectedText

        var _op = firstSelected();
        var _firstTextOp = undefined;
        var _rectangles = [];
        while (_op) {
                if (isTextOp( _op )) {
                        var _pom = getFirstTextOp( _op );

                        if (_firstTextOp == undefined)
                                _firstTextOp = _pom;

                        if ( ! _pom.equals (_firstTextOp) ) {
                                operatorDrawRect( _rectangles, getColor("bg"), 
0, _firstTextOp );
                                _firstTextOp = _pom;
                                _rectangles = [];
                        }

                        var _br = _op.getBBox();
                        var _x1 = convertPixmapPosToPdfPos_x( _br[0], _br[1] );
                        var _y1 = convertPixmapPosToPdfPos_y( _br[0], _br[1] );
                        var _x2 = convertPixmapPosToPdfPos_x( _br[2], _br[3] );
                        var _y2 = convertPixmapPosToPdfPos_y( _br[2], _br[3] );

                        _rectangles.push( [_x1, _y1, _x2-_x1, _y2-_y1 ] );
                }

  


hope it helps,
jozef




> Date: Fri, 4 Mar 2011 11:53:01 -0500
> From: e...@doviak.net
> To: pdfedit-support@lists.sourceforge.net
> Subject: Re: [Pdfedit-support] How do I obtain the bounding box values?
> 
> >
> >> How can I obtain a list all text and graphic objects on a given page?
> >> How do I call getBBox on them?
> >>      
> > I am not familiar with the scripting but operators should be accesible
> > via content stream object. Jozo might tell you more. Anyway I would
> > rather use the gs if it implements this feature.
> >    
> 
> That's the most practical suggestion. Developing a PDFedit algorithm to 
> calculate the "page bounding box" would duplicate what Ghostscript has 
> already done.
> 
> But still, I wonder ...
> 
> Jozo's PDF-to-XML script contains the bounding box information from each 
> operator, so it must be possible to create a pure PDFedit implementation.
> 
> I'll think about it some more and write back when I have something that 
> works.
> 
> Thanks,
> - Eric
> 
> 
> ------------------------------------------------------------------------------
> What You Don't Know About Data Connectivity CAN Hurt You
> This paper provides an overview of data connectivity, details
> its effect on application quality, and explores various alternative
> solutions. http://p.sf.net/sfu/progress-d2d
> _______________________________________________
> Pdfedit-support mailing list
> Pdfedit-support@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/pdfedit-support
                                          
------------------------------------------------------------------------------
What You Don't Know About Data Connectivity CAN Hurt You
This paper provides an overview of data connectivity, details
its effect on application quality, and explores various alternative
solutions. http://p.sf.net/sfu/progress-d2d
_______________________________________________
Pdfedit-support mailing list
Pdfedit-support@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pdfedit-support

Reply via email to