Package org.apache.pdfbox.cos

Examples of org.apache.pdfbox.cos.COSFloat


    {
        COSArray gamma = (COSArray)dictionary.getDictionaryObject(COSName.GAMMA);
        if(gamma == null)
        {
            gamma = new COSArray();
            gamma.add(new COSFloat(1.0f));
            gamma.add(new COSFloat(1.0f));
            gamma.add(new COSFloat(1.0f));
            dictionary.setItem(COSName.GAMMA, gamma);
        }
        return new PDGamma(gamma);
    }
View Full Code Here


     * Constructor. Defaults all values to 0, 0, 0.
     */
    public PDTristimulus()
    {
        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

    public PDTristimulus(float[] array)
    {
        values = new COSArray();
        for(int i=0; i<array.length && i<3; i++)
        {
            values.add(new COSFloat(array[i]));
        }
    }
View Full Code Here

     * Sets the x value of the tristimulus.
     * @param x the x value for the tristimulus
     */
    public void setX(float x)
    {
        values.set(0, new COSFloat(x));
    }
View Full Code Here

     * Sets the y value of the tristimulus.
     * @param y the y value for the tristimulus
     */
    public void setY(float y)
    {
        values.set(1, new COSFloat(y));
    }
View Full Code Here

     * Sets the z value of the tristimulus.
     * @param z the z value for the tristimulus
     */
    public void setZ(float z)
    {
        values.set(2, new COSFloat(z));
    }
View Full Code Here

    }

    protected COSNumber parseNumber(String number) throws IOException {
        if(number.matches("^[0-9]+$"))
            return COSInteger.get(number);
        return new COSFloat(Float.parseFloat(number));
    }
View Full Code Here

    @Test
    public void testIsFloat()
    {
        try
        {
            COSObject co = new COSObject(new COSFloat(10.0f));
            co.setGenerationNumber(COSInteger.ZERO);
            co.setObjectNumber(new COSInteger(10));

            assertFalse(COSUtils.isFloat(co, new IOCOSDocument()));
View Full Code Here

                                drawnString.reset();
                                drawnString.append( apValue.getBytes("ISO-8859-1") );
                            }
                        }
                        int setFontIndex = tokens.indexOf( PDFOperator.getOperator( "Tf" ));
                        tokens.set( setFontIndex-1, new COSFloat( fontSize ) );
                        if( foundString )
                        {
                            writer.writeTokens( tokens );
                        }
                        else
View Full Code Here

            List<Object> 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

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.