Package org.pdfbox.cos

Examples of org.pdfbox.cos.COSArray


     *
     * @return The Rect value of this annotation.
     */
    public PDRectangle getRectangle()
    {
        COSArray rectArray = (COSArray)dictionary.getDictionaryObject( COSName.getPDFName( "Rect" ) );
        PDRectangle rectangle = null;
        if( rectArray != null )
        {
            rectangle = new PDRectangle( rectArray );
        }
View Full Code Here


     * @return PDGamma object representing the colour
     *
     */
    public PDGamma getColour()
    {
        COSArray c = (COSArray) getDictionary().getItem(COSName.getPDFName( "C" ) );
        if (c != null)
        {
            return new PDGamma( c );
        }
        else
View Full Code Here

     *
     * @return The blackpoint tristimulus.
     */
    public PDTristimulus getBlackPoint()
    {
        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

     *
     * @return The gamma value.
     */
    public PDGamma getGamma()
    {
        COSArray gamma = (COSArray)dictionary.getDictionaryObject( COSName.getPDFName( "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.getPDFName( "Gamma" ), gamma );
        }
        return new PDGamma( gamma );
    }
View Full Code Here

     *
     * @param value The new gamma value.
     */
    public void setGamma( PDGamma value )
    {
        COSArray gamma = null;
        if( value != null )
        {
            gamma = value.getCOSArray();
        }
        dictionary.setItem( COSName.getPDFName( "Gamma" ), gamma );
View Full Code Here

     * @return The linear interpretation matrix.
     */
    public PDMatrix getLinearInterpretation()
    {
        PDMatrix retval = null;
        COSArray matrix = (COSArray)dictionary.getDictionaryObject( COSName.getPDFName( "Matrix" ) );
        if( matrix == null )
        {
            retval = new PDMatrix();
            setLinearInterpretation( retval );
        }
View Full Code Here

     *
     * @param matrix The new linear interpretation matrix.
     */
    public void setLinearInterpretation( PDMatrix matrix )
    {
        COSArray matrixArray = null;
        if( matrix != null )
        {
            matrixArray = matrix.getCOSArray();
        }
        dictionary.setItem( COSName.getPDFName( "Matrix" ), matrixArray );
View Full Code Here

    /**
     * Constructor, default DeviceRGB, hival 255.
     */
    public PDIndexed()
    {
        array = new COSArray();
        array.add( COSName.getPDFName( NAME ) );
        array.add( COSName.getPDFName( PDDeviceRGB.NAME ) );
        array.add( new COSInteger( 255 ) );
        array.add( org.pdfbox.cos.COSNull.NULL );
    }
View Full Code Here

        {
            retval = createColorSpace( ((COSName)colorSpace).getName() );
        }
        else if( colorSpace instanceof COSArray )
        {
            COSArray array = (COSArray)colorSpace;
            COSName type = (COSName)array.getObject( 0 );
            if( type.getName().equals( PDCalGray.NAME ) )
            {
                retval = new PDCalGray( array );
            }
            else if( type.getName().equals( PDCalRGB.NAME ) )
View Full Code Here

        else if( cs instanceof ICC_ColorSpace )
        {
            ICC_ColorSpace ics = (ICC_ColorSpace)cs;
            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.pdfbox.cos.COSArray

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.