Package org.pdfbox.cos

Examples of org.pdfbox.cos.COSFloat


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


        editedPageTokens.remove( editedPageTokens.size() -1 );
        editedPageTokens.remove( editedPageTokens.size() -1 );
        editedPageTokens.remove( editedPageTokens.size() -1 );

        // Add the new CMYK color
        editedPageTokens.add( new COSFloat( cmyk[0] ) );
        editedPageTokens.add( new COSFloat( cmyk[1] ) );
        editedPageTokens.add( new COSFloat( cmyk[2] ) );
        editedPageTokens.add( new COSFloat( cmyk[3] ) );
    }
View Full Code Here

        //remove the Gray components that are already part of the editedPageTokens list
        editedPageTokens.remove( editedPageTokens.size() -1 );

        // Add the new CMYK color
        editedPageTokens.add( new COSFloat( cmyk[0] ) );
        editedPageTokens.add( new COSFloat( cmyk[1] ) );
        editedPageTokens.add( new COSFloat( cmyk[2] ) );
        editedPageTokens.add( new COSFloat( cmyk[3] ) );
    }
View Full Code Here

    {
        //move text position and set leading
        COSNumber y = (COSNumber)arguments.get( 1 );
       
        ArrayList args = new ArrayList();
        args.add(new COSFloat(-1*y.floatValue()));
        context.processOperator("TL", args);
        context.processOperator("Td", arguments);

    }
View Full Code Here

     *
     * @param value The new gamma value.
     */
    public void setGamma( float value )
    {
        dictionary.setItem( COSName.getPDFName( "Gamma" ), new COSFloat( value ) );
    }
View Full Code Here

    {
        COSArray wp = (COSArray)dictionary.getDictionaryObject( COSName.getPDFName( "WhitePoint" ) );
        if( wp == null )
        {
            wp = new COSArray();
            wp.add( new COSFloat( 1.0f ) );
            wp.add( new COSFloat( 1.0f ) );
            wp.add( new COSFloat( 1.0f ) );
            dictionary.setItem( COSName.getPDFName( "WhitePoint" ), wp );
        }
        return new PDTristimulus( wp );
    }
View Full Code Here

    {
        COSArray bp = (COSArray)dictionary.getDictionaryObject( COSName.getPDFName( "BlackPoint" ) );
        if( bp == null )
        {
            bp = new COSArray();
            bp.add( new COSFloat( 0.0f ) );
            bp.add( new COSFloat( 0.0f ) );
            bp.add( new COSFloat( 0.0f ) );
            dictionary.setItem( COSName.getPDFName( "BlackPoint" ), bp );
        }
        return new PDTristimulus( bp );
    }
View Full Code Here

     * Constructor.  Defaults all values to 0, 0, 0.
     */
    public PDGamma()
    {
        values = new COSArray();
        values.add( new COSFloat( 0.0f ) );
        values.add( new COSFloat( 0.0f ) );
        values.add( new COSFloat( 0.0f ) );
    }
View Full Code Here

     *
     * @param r The r value for the tristimulus.
     */
    public void setR( float r )
    {
        values.set( 0, new COSFloat( r ) );
    }
View Full Code Here

     *
     * @param g The g value for the tristimulus.
     */
    public void setG( float g )
    {
        values.set( 1, new COSFloat( g ) );
    }
View Full Code Here

TOP

Related Classes of org.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.