Examples of PDRectangle


Examples of org.apache.pdfbox.pdmodel.common.PDRectangle

    {
        ensureLoaded();

        if( this.fontBBox == null )
        {
            this.fontBBox = new PDRectangle(this.fontMetric.getFontBBox());
        }

        return this.fontBBox;
    }
View Full Code Here

Examples of org.apache.pdfbox.pdmodel.common.PDRectangle

        if (desc != null)
        {
            // the following values are all more or less accurate at least all are average
            // values. Maybe we'll find another way to get those value for every single glyph
            // in the future if needed
            PDRectangle fontBBox = desc.getFontBoundingBox();
            float retval = 0;
            if (fontBBox != null)
            {
                retval = fontBBox.getHeight() / 2;
            }
            if (retval == 0)
            {
                retval = desc.getCapHeight();
            }
View Full Code Here

Examples of org.apache.pdfbox.pdmodel.common.PDRectangle

     * @return The fonts bounding box.
     */
    public PDRectangle getFontBBox()
    {
        COSArray rect = (COSArray) dict.getDictionaryObject(COSName.FONT_BBOX);
        PDRectangle retval = null;
        if(rect != null)
        {
            retval = new PDRectangle(rect);
        }
        return retval;
    }
View Full Code Here

Examples of org.apache.pdfbox.pdmodel.common.PDRectangle

    }

    @Override
    public BoundingBox getBoundingBox()
    {
        PDRectangle rect = getFontBBox();
        return new BoundingBox(rect.getLowerLeftX(), rect.getLowerLeftY(),
                               rect.getWidth(), rect.getHeight());
    }
View Full Code Here

Examples of org.apache.pdfbox.pdmodel.common.PDRectangle

            throw new IllegalArgumentException("First page of pdf is 1, not " + page);
        }


        PDPage firstPage = document.getPage(page - 1);
        PDRectangle mediaBox = firstPage.getMediaBox();
        pageHeight(mediaBox.getHeight());
        pageWidth = mediaBox.getWidth();

        float x = this.pageWidth;
        float y = 0;
        pageWidth = this.pageWidth + y;
        float tPercent = (100 * y / (x + y));
View Full Code Here

Examples of org.apache.pdfbox.pdmodel.common.PDRectangle

            {
                values[i] = Float.parseFloat( rectValues[i] );
            }
            COSArray array = new COSArray();
            array.setFloatArray( values );
            setRectangle( new PDRectangle( array ) );
        }

        setName( element.getAttribute( "title" ) );
        setCreationDate( DateConverter.toCalendar( element.getAttribute( "creationdate" ) ) );
        String opac = element.getAttribute( "opacity" );
View Full Code Here

Examples of org.apache.pdfbox.pdmodel.common.PDRectangle

     *
     * @return The annotation rectangle.
     */
    public PDRectangle getRectangle()
    {
        PDRectangle retval = null;
        COSArray rectArray = (COSArray)annot.getDictionaryObject( COSName.RECT );
        if( rectArray != null )
        {
            retval = new PDRectangle( rectArray );
        }
        return retval;
    }
View Full Code Here

Examples of org.pdfbox.pdmodel.common.PDRectangle

     * @return The Rect value of this annotation.
     */
    public PDRectangle getRectangle()
    {
        COSArray rectArray = (COSArray)dictionary.getDictionaryObject( COSName.getPDFName( "Rect" ) );
        PDRectangle rectangle = null;
        if( rectArray != null )
        {
            rectangle = new PDRectangle( rectArray );
        }
        return rectangle;
    }
View Full Code Here

Examples of org.pdfbox.pdmodel.common.PDRectangle

                for( int i=0; i<pageArticles.size() && foundArticleDivisionIndex == -1; i++ )
                {
                    PDThreadBead bead = (PDThreadBead)pageArticles.get( i );
                    if( bead != null )
                    {
                        PDRectangle rect = bead.getRectangle();
                        if( rect.contains( x, y ) )
                        {
                            foundArticleDivisionIndex = i*2+1;
                        }
                        else if( (x < rect.getLowerLeftX() ||
                                  y < rect.getUpperRightY()) &&
                            notFoundButFirstLeftAndAboveArticleDivisionIndex == -1)
                        {
                            notFoundButFirstLeftAndAboveArticleDivisionIndex = i*2;
                        }
                        else if( x < rect.getLowerLeftX() &&
                                notFoundButFirstLeftArticleDivisionIndex == -1)
                        {
                            notFoundButFirstLeftArticleDivisionIndex = i*2;
                        }
                        else if( y < rect.getUpperRightY() &&
                                notFoundButFirstAboveArticleDivisionIndex == -1)
                        {
                            notFoundButFirstAboveArticleDivisionIndex = i*2;
                        }                       
                    }
View Full Code Here

Examples of org.pdfbox.pdmodel.common.PDRectangle

     *
     * @return The part of the page that this bead covers.
     */
    public PDRectangle getRectangle()
    {
        PDRectangle rect = null;
        COSArray array = (COSArray)bead.getDictionaryObject( COSName.R );
        if( array != null )
        {
            rect = new PDRectangle( array );
        }
        return rect;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.