Package org.pdfbox.cos

Examples of org.pdfbox.cos.COSBase


     */
    public List getFileDecodeParams() throws IOException
    {
        List retval = null;
       
        COSBase dp = stream.getDictionaryObject( "FDecodeParms" );
        if( dp instanceof COSDictionary )
        {
            Map map = COSDictionaryMap.convertBasicTypesToMap( (COSDictionary)dp );
            retval = new COSArrayList(map, dp, stream, "FDecodeParams" );
        }
View Full Code Here


        return dictionary;
    }

    private COSBase getCOSObject( String abbreviatedName, String name )
    {
        COSBase retval = dictionary.getDictionaryObject( COSName.getPDFName( abbreviatedName ) );
        if( retval == null )
        {
            retval = dictionary.getDictionaryObject( COSName.getPDFName( name ) );
        }
        return retval;
View Full Code Here

     *
     * @throws IOException If there is an error getting the colorspace.
     */
    public PDColorSpace getColorSpace() throws IOException
    {
        COSBase cs = getCOSObject( "CS", "ColorSpace" );
        PDColorSpace retval = null;
        if( cs != null )
        {
            retval = PDColorSpaceFactory.createColorSpace( cs );
        }
View Full Code Here

     *
     * @param cs The color space for this image.
     */
    public void setColorSpace( PDColorSpace cs )
    {
        COSBase base = null;
        if( cs != null )
        {
            base = cs.getCOSObject();
        }
        dictionary.setItem( COSName.getPDFName( "CS" ), base );
View Full Code Here

     * @return A list of all encoding filters to apply to this stream.
     */
    public List getFilters()
    {
        List retval = null;
        COSBase filters = dictionary.getDictionaryObject( new String[] {"Filter", "F"} );
        if( filters instanceof COSName )
        {
            COSName name = (COSName)filters;
            retval = new COSArrayList( name.getName(), name, dictionary, "Filter" );
        }
View Full Code Here

     *
     * @param filters The filters that are part of this stream.
     */
    public void setFilters( List filters )
    {
        COSBase obj = COSArrayList.convertStringListToCOSNameCOSArray( filters );
        dictionary.setItem( "Filter", obj );
    }
View Full Code Here

    /**
     * {@inheritDoc}
     */
    protected Object convertCOSToPD( COSBase base ) throws IOException
    {
        COSBase destination = base;
        return new PDComplexFileSpecification( (COSDictionary)destination );
    }
View Full Code Here

                int objectNumber = readInt();
                int offset = readInt();
                objectNumbers.add( new Integer( objectNumber ) );
            }
            COSObject object = null;
            COSBase cosObject = null;
            int objectCounter = 0;
            while( (cosObject = parseDirObject()) != null )
            {
                object = new COSObject(cosObject);
                object.setGenerationNumber( COSInteger.ZERO );
View Full Code Here

            COSDictionary obj = (COSDictionary)o;
            output.write( COSWriter.DICT_OPEN );
            for (Iterator i = obj.keyList().iterator(); i.hasNext();)
            {
                COSName name = (COSName) i.next();
                COSBase value = obj.getItem(name);
                if (value != null)
                {
                    writeObject( name );
                    output.write( SPACE );
View Full Code Here

        //now replace with the differences.
        COSArray differences = (COSArray)encoding.getDictionaryObject( COSName.DIFFERENCES );
        int currentIndex = -1;
        for( int i=0; differences != null && i<differences.size(); i++ )
        {
            COSBase next = differences.getObject( i );
            if( next instanceof COSNumber )
            {
                currentIndex = ((COSNumber)next).intValue();
            }
            else if( next instanceof COSName )
View Full Code Here

TOP

Related Classes of org.pdfbox.cos.COSBase

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.