Package org.apache.pdfbox.cos

Examples of org.apache.pdfbox.cos.COSFloat


                            {
                                try
                                {
                                    for (int i=0;i<6;i++)
                                    {
                                        COSFloat floatValue = new COSFloat(Float.parseFloat(st.nextToken()));
                                        array.add(floatValue);
                                    }
                                    fontMatrix = new PDMatrix(array);
                                }
                                catch (NumberFormatException exception)
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 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

            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

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

        input = new COSArray();
        input.setFloatArray(new float[] {0.8f, 0.3f}); //results in 1.1f being outside Range
        output = function.eval(input);

        assertEquals(1, output.size());
        assertEquals(new COSFloat(1.0f), output.get(0));

        input = new COSArray();
        input.setFloatArray(new float[] {0.8f, 1.2f}); //input argument outside Dimension
        output = function.eval(input);

        assertEquals(1, output.size());
        assertEquals(new COSFloat(1.0f), output.get(0));
    }
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

            domain = (COSArray)(DictShading.getDictionaryObject(COSName.DOMAIN));
            // use default values
            if (domain == null)
            {
                domain = new COSArray();
                domain.add(new COSFloat(0.0f));
                domain.add(new COSFloat(1.0f));
            }
        }
        return domain;
    }
View Full Code Here

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

        {
            graphicsState.removeItem( key );
        }
        else
        {
            graphicsState.setItem( key, new COSFloat( value.floatValue() ) );
        }
    }
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.