Package org.apache.pdfbox.cos

Examples of org.apache.pdfbox.cos.COSFloat


        PDMatrix matrix = null;
        COSArray array = (COSArray)font.getDictionaryObject( COSName.FONT_MATRIX );
        if( array == null )
        {
            array = new COSArray();
            array.add( new COSFloat( 0.001f ) );
            array.add( COSNumber.ZERO );
            array.add( COSNumber.ZERO );
            array.add( new COSFloat( 0.001f ) );
            array.add( COSNumber.ZERO );
            array.add( COSNumber.ZERO );
        }
        matrix = new PDMatrix(array);
View Full Code Here


     * @param height The height of the rectangle.
     */
    public PDRectangle( float x, float y, float width, float height )
    {
        rectArray = new COSArray();
        rectArray.add( new COSFloat( x ) );
        rectArray.add( new COSFloat( y ) );
        rectArray.add( new COSFloat( x + width ) );
        rectArray.add( new COSFloat( y + height ) );
    }
View Full Code Here

     * @param box the bounding box to be used for the rectangle
     */
    public PDRectangle( BoundingBox box )
    {
        rectArray = new COSArray();
        rectArray.add( new COSFloat( box.getLowerLeftX() ) );
        rectArray.add( new COSFloat( box.getLowerLeftY() ) );
        rectArray.add( new COSFloat( box.getUpperRightX() ) );
        rectArray.add( new COSFloat( box.getUpperRightY() ) );
    }
View Full Code Here

    public PDRectangle( COSArray array )
    {
        float[] values = array.toFloatArray();
        rectArray = new COSArray();
        // we have to start with the lower left corner
        rectArray.add( new COSFloat( Math.min(values[0],values[2] )) );
        rectArray.add( new COSFloat( Math.min(values[1],values[3] )) );
        rectArray.add( new COSFloat( Math.max(values[0],values[2] )) );
        rectArray.add( new COSFloat( Math.max(values[1],values[3] )) );
    }
View Full Code Here

     *
     * @param value The lower left x.
     */
    public void setLowerLeftX(float value)
    {
        rectArray.set(0, new COSFloat( value ) );
    }
View Full Code Here

     *
     * @param value The lower left y.
     */
    public void setLowerLeftY(float value)
    {
        rectArray.set(1, new COSFloat( value ) );
    }
View Full Code Here

     *
     * @param value The upper right x .
     */
    public void setUpperRightX(float value)
    {
        rectArray.set(2, new COSFloat( value ) );
    }
View Full Code Here

     *
     * @param value The upper right y.
     */
    public void setUpperRightY(float value)
    {
        rectArray.set(3, new COSFloat( value ) );
    }
View Full Code Here

                        ByteArrayOutputStream output = new ByteArrayOutputStream();
                        ContentStreamWriter writer = new ContentStreamWriter(output);
                        float fontSize = calculateFontSize(pdFont,
                                appearanceStream.getBBox(), tokens, daTokens);
                        int setFontIndex = tokens.indexOf(Operator.getOperator("Tf"));
                        tokens.set(setFontIndex - 1, new COSFloat(fontSize));

                        int bmcIndex = tokens.indexOf(Operator.getOperator("BMC"));
                        int emcIndex = tokens.indexOf(Operator.getOperator("EMC"));

                        if (bmcIndex != -1)
View Full Code Here

            List<Object> daTokens = daParser.getTokens();
            fontSize = calculateFontSize(pdFont, boundingBox, tokens, daTokens);
            int fontIndex = daTokens.indexOf(Operator.getOperator("Tf"));
            if (fontIndex != -1)
            {
                daTokens.set(fontIndex - 1, new COSFloat(fontSize));
            }
            ContentStreamWriter daWriter = new ContentStreamWriter(output);
            daWriter.writeTokens(daTokens);
        }
View Full Code Here

TOP

Related Classes of org.apache.pdfbox.cos.COSFloat

Copyright © 2018 www.massapicom. 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.