Package org.pdfbox.cos

Examples of org.pdfbox.cos.COSNumber.floatValue()


        super.process( operator, arguments );
        PageDrawer drawer = (PageDrawer)context;
        COSNumber r = (COSNumber)arguments.get( 0 );
        COSNumber g = (COSNumber)arguments.get( 1 );
        COSNumber b = (COSNumber)arguments.get( 2 );
        drawer.setStrokingColor( new Color( r.floatValue(), g.floatValue(), b.floatValue() ) );
    }
}
View Full Code Here


     * @return The min value.
     */
    public float getMin()
    {
        COSNumber min = (COSNumber)rangeArray.getObject( startingIndex*2 );
        return min.floatValue();
    }

    /**
     * This will set the minimum value for the range.
     *
 
View Full Code Here

     * @return The max value.
     */
    public float getMax()
    {
        COSNumber max = (COSNumber)rangeArray.getObject( startingIndex*2+1 );
        return max.floatValue();
    }

    /**
     * This will set the maximum value for the range.
     *
 
View Full Code Here

            //in the list
            Object charSpacing = arguments.get( arguments.size()-1 );
            if( charSpacing instanceof COSNumber )
            {
                COSNumber characterSpacing = (COSNumber)charSpacing;
                context.getGraphicsState().getTextState().setCharacterSpacing( characterSpacing.floatValue() );
            }
        }
    }
}
View Full Code Here

     * @throws IOException If an error occurs while processing the font.
     */
    public void process(PDFOperator operator, List arguments) throws IOException
    {
        COSNumber scaling = (COSNumber)arguments.get(0);
        context.getGraphicsState().getTextState().setHorizontalScalingPercent( scaling.floatValue() );
    }
}
View Full Code Here

        textMatrix.setValue( 0, 0, a.floatValue() );
        textMatrix.setValue( 0, 1, b.floatValue() );
        textMatrix.setValue( 1, 0, c.floatValue() );
        textMatrix.setValue( 1, 1, d.floatValue() );
        textMatrix.setValue( 2, 0, e.floatValue() );
        textMatrix.setValue( 2, 1, f.floatValue() );
        context.setTextMatrix( textMatrix );
        context.setTextLineMatrix( textMatrix.copy() );
    }
}
View Full Code Here

                COSNumber height = (COSNumber)tokens.get( i-1 );
                PDRectangle potentialSmallest = new PDRectangle();
                potentialSmallest.setLowerLeftX( x.floatValue() );
                potentialSmallest.setLowerLeftY( y.floatValue() );
                potentialSmallest.setUpperRightX( x.floatValue() + width.floatValue() );
                potentialSmallest.setUpperRightY( y.floatValue() + height.floatValue() );
                if( smallest == null ||
                    smallest.getLowerLeftX() < potentialSmallest.getLowerLeftX() ||
                    smallest.getUpperRightY() > potentialSmallest.getUpperRightY() )
                {
                    smallest = potentialSmallest;
View Full Code Here

            //height = verticalWidth.intValue();
            box = new BoundingBox();
            box.setLowerLeftX( llx.floatValue() );
            box.setLowerLeftY( lly.floatValue() );
            box.setUpperRightX( urx.floatValue() );
            box.setUpperRightY( ury.floatValue() );
        }/*
        else if( operation.equals( "Do" ) )
        {
            //invoke named object.
        }
View Full Code Here

                long last = lastChar.intValue();
                if( code >= first && code <= last && font.getDictionaryObject( COSName.WIDTHS ) != null )
                {
                    COSArray widthArray = (COSArray)font.getDictionaryObject( COSName.WIDTHS );
                    COSNumber fontWidthObject = (COSNumber)widthArray.getObject( (int)(code - first) );
                    fontWidth = fontWidthObject.floatValue();
                }
                else
                {
                    fontWidth = getFontWidthFromAFMFile( code );
                }
View Full Code Here

            if( widths != null )
            {
                for( int i=0; i<widths.size(); i++ )
                {
                    COSNumber fontWidth = (COSNumber)widths.getObject( i );
                    if( fontWidth.floatValue() > 0 )
                    {
                        totalWidth += fontWidth.floatValue();
                        characterCount += 1;
                    }
                }
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.