Package org.apache.pdfbox.cos

Examples of org.apache.pdfbox.cos.COSFloat


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


        COSArray matrix = new COSArray();
        double[] values = new double[6];
        transform.getMatrix(values);
        for (double v : values)
        {
            matrix.add(new COSFloat((float) v));
        }
        getCOSStream().setItem(COSName.MATRIX, matrix);
    }
View Full Code Here

            if( numbers != null && numbers.size() == 6 )
            {
                COSArray array = new COSArray();
                for(Number number : numbers)
                {
                    array.add(new COSFloat(number.floatValue()));
                }
                fontMatrix = new PDMatrix(array);
            }
            else
            {
View Full Code Here

                                {
                                    try
                                    {
                                        for (int i=0;i<6;i++)
                                        {
                                            COSFloat floatValue = new COSFloat(Float.parseFloat(st.nextToken()));
                                            array.add(floatValue);
                                        }
                                    }
                                    catch (NumberFormatException exception)
                                    {
                                        log.error("Can't read the fontmatrix from embedded font file!");
                                    }
                                    fontMatrix = new PDMatrix(array);
                                }
                            }
                            else
                            {
                                // there are fonts where all values are on a separate line, see PDFBOX-1611
                                COSArray array = new COSArray();
                                while((line = in.readLine()) != null)
                                {
                                    if (line.startsWith("["))
                                    {
                                        continue;
                                    }
                                    if (line.endsWith("]"))
                                    {
                                        break;
                                    }
                                    try
                                    {
                                        COSFloat floatValue = new COSFloat(Float.parseFloat(line));
                                        array.add(floatValue);
                                    }
                                    catch (NumberFormatException exception)
                                    {
                                        log.error("Can't read the fontmatrix from embedded font file!");
View Full Code Here

    {
        COSArray wp = (COSArray)dictionary.getDictionaryObject( COSName.WHITE_POINT );
        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.WHITE_POINT, wp );
        }
        return new PDTristimulus( wp );
    }
View Full Code Here

    {
        COSArray bp = (COSArray)dictionary.getDictionaryObject( COSName.BLACK_POINT );
        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.BLACK_POINT, bp );
        }
        return new PDTristimulus( bp );
    }
View Full Code Here

        COSArray range = (COSArray)dictionary.getDictionaryObject( COSName.RANGE );
        if( range == null )
        {
            range = new COSArray();
            dictionary.setItem( COSName.RANGE, array );
            range.add( new COSFloat( -100 ) );
            range.add( new COSFloat( 100 ) );
            range.add( new COSFloat( -100 ) );
            range.add( new COSFloat( 100 ) );
        }
        return range;
    }
View Full Code Here

        COSArray rangeArray = null;
        //if null then reset to defaults
        if( range == null )
        {
            rangeArray = getRangeArray();
            rangeArray.set( 0, new COSFloat( -100 ) );
            rangeArray.set( 1, new COSFloat( 100 ) );
        }
        else
        {
            rangeArray = range.getCOSArray();
        }
View Full Code Here

        COSArray rangeArray = null;
        //if null then reset to defaults
        if( range == null )
        {
            rangeArray = getRangeArray();
            rangeArray.set( 2, new COSFloat( -100 ) );
            rangeArray.set( 3, new COSFloat( 100 ) );
        }
        else
        {
            rangeArray = range.getCOSArray();
        }
View Full Code Here

            PDICCBased pdCS = new PDICCBased( doc );
            retval = pdCS;
            COSArray ranges = new COSArray();
            for( int i=0; i<cs.getNumComponents(); i++ )
            {
                ranges.add( new COSFloat( ics.getMinValue( i ) ) );
                ranges.add( new COSFloat( ics.getMaxValue( i ) ) );
            }
            PDStream iccData = pdCS.getPDStream();
            OutputStream output = null;
            try
            {
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.