Examples of COSObjectKey


Examples of org.apache.pdfbox.persistence.util.COSObjectKey

            co.setObjectNumber(COSInteger.get(10));

            assertFalse(COSUtils.isFloat(co, new IOCOSDocument()));

            COSDocument doc = new COSDocument();
            addToXref(doc, new COSObjectKey(co), 1000);
            COSUtils.isFloat(co, doc);
            doc.close();
        }
        catch (IOException e)
        {
View Full Code Here

Examples of org.apache.pdfbox.persistence.util.COSObjectKey

            co.setObjectNumber(COSInteger.get(10));

            assertFalse(COSUtils.isString(co, new IOCOSDocument()));

            COSDocument doc = new COSDocument();
            addToXref(doc, new COSObjectKey(co), 1000);
            COSUtils.isString(co, doc);
            doc.close();
        }
        catch (IOException e)
        {
View Full Code Here

Examples of org.apache.pdfbox.persistence.util.COSObjectKey

            co.setObjectNumber(COSInteger.get(10));

            assertFalse(COSUtils.isStream(co, new IOCOSDocument()));

            COSDocument doc = new COSDocument();
            addToXref(doc, new COSObjectKey(co), 1000);
            COSUtils.isStream(co, doc);
            doc.close();
        }
        catch (IOException e)
        {
View Full Code Here

Examples of org.apache.pdfbox.persistence.util.COSObjectKey

            co.setObjectNumber(COSInteger.get(10));

            assertFalse(COSUtils.isDictionary(co, new IOCOSDocument()));

            COSDocument doc = new COSDocument();
            addToXref(doc, new COSObjectKey(co), 1000);
            COSUtils.isDictionary(co, doc);
            doc.close();
        }
        catch (IOException e)
        {
View Full Code Here

Examples of org.pdfbox.persistence.util.COSObjectKey

        COSBase actual = obj;
        if( actual instanceof COSObject )
        {
            actual = ((COSObject)obj).getObject();
        }
        COSObjectKey key = null;
        if( actual != null )
        {
            key = (COSObjectKey)objectKeys.get(actual);
        }
        if( key == null )
        {
            key = (COSObjectKey)objectKeys.get(obj);
        }
        if (key == null)
        {
            setNumber(getNumber()+1);
            key = new COSObjectKey(getNumber(),0);
            objectKeys.put(obj, key);
            if( actual != null )
            {
                objectKeys.put(actual, key);
            }
View Full Code Here

Examples of org.pdfbox.persistence.util.COSObjectKey

     */
    public void writeReference(COSBase obj) throws COSVisitorException
    {
        try
        {
            COSObjectKey  key = getObjectKey(obj);
            getStandardOutput().write(String.valueOf(key.getNumber()).getBytes());
            getStandardOutput().write(SPACE);
            getStandardOutput().write(String.valueOf(key.getGeneration()).getBytes());
            getStandardOutput().write(SPACE);
            getStandardOutput().write(REFERENCE);
        }
        catch (IOException e)
        {
View Full Code Here

Examples of org.pdfbox.persistence.util.COSObjectKey

            char r = (char)pdfSource.read();
            if( r != 'R' )
            {
                throw new IOException( "expected='R' actual='" + r + "' " + pdfSource );
            }
            COSObjectKey key = new COSObjectKey(((COSInteger) number).intValue(),
                                                ((COSInteger) generationNumber).intValue());
            retval = document.getObjectFromPool(key);
        }
        else
        {
View Full Code Here

Examples of org.pdfbox.persistence.util.COSObjectKey

            pbo = parseDirObject();
            if( pbo instanceof COSObject )
            {
                COSInteger genNumber = (COSInteger)po.remove( po.size() -1 );
                COSInteger number = (COSInteger)po.remove( po.size() -1 );
                COSObjectKey key = new COSObjectKey(number.intValue(), genNumber.intValue());
                pbo = document.getObjectFromPool(key);
            }
            if( pbo != null )
            {
                po.add( pbo );
View Full Code Here

Examples of org.pdfbox.persistence.util.COSObjectKey

            parser.parse();
            Iterator compressedObjects = parser.getObjects().iterator();
            while( compressedObjects.hasNext() )
            {
                COSObject next = (COSObject)compressedObjects.next();
                COSObjectKey key = new COSObjectKey( next );
                COSObject obj = getObjectFromPool( key );
                obj.setObject( next.getObject() );
            }
        }
    }
View Full Code Here

Examples of org.pdfbox.persistence.util.COSObjectKey

     *
     * @throws IOException If there is an error adding the object.
     */
    public COSObject addObject(COSObject obj) throws IOException
    {
        COSObjectKey key = null;
        if( obj.getObjectNumber() != null )
        {
            key = new COSObjectKey( obj );
        }
        COSObject fromPool = getObjectFromPool( key );
        fromPool.setObject( obj.getObject() );
        return fromPool;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.