Package org.apache.pdfbox.cos

Examples of org.apache.pdfbox.cos.COSName


                    if (length == -1)
                    {
                        streamLengthCheckSet.add(strmObj);
                    }
                   
                    final COSName objectType = (COSName)strmObj.getItem( COSName.TYPE );
                    if( objectType != null && objectType.equals( COSName.XREF ) )
                    {
                        // XRef stream
                        parseXrefStream( strmObj, currentObjByteOffset );
                    }
                }
View Full Code Here


        if (root != null)
        {
            COSBase item = root.getItem(COSName.VERSION);
            if (item instanceof COSName)
            {
                COSName version = (COSName) item;
                float trailerVersion = Float.valueOf(version.getName());
                if (trailerVersion > document.getVersion())
                {
                    document.setVersion(trailerVersion);
                }
            }
View Full Code Here

{
    @Override
    public void process(Operator operator, List<COSBase> arguments) throws IOException
    {
        // set parameters from graphics state parameter dictionary
        COSName graphicsName = (COSName)arguments.get( 0 );
        PDExternalGraphicsState gs = context.getResources().getExtGState(graphicsName);
        gs.copyIntoGraphicsState( context.getGraphicsState() );
    }
View Full Code Here

    private static final Log LOG = LogFactory.getLog(DrawObject.class);

    @Override
    public void process(Operator operator, List<COSBase> operands) throws IOException
    {
        COSName objectName = (COSName)operands.get(0);
        PDXObject xobject = context.getResources().getXObject(objectName);

        if (xobject == null)
        {
            LOG.warn("Can't find the XObject named '" + objectName.getName() + "'");
        }
        else if (xobject instanceof PDImageXObject)
        {
            PDImageXObject image = (PDImageXObject)xobject;
            try
View Full Code Here

     * @return the base state
     */
    public BaseState getBaseState()
    {
        COSDictionary d = getD();
        COSName name = (COSName)d.getItem(COSName.BASE_STATE);
        return BaseState.valueOf(name);
    }
View Full Code Here

                        return obj;
                    }
                }
            else
            {
                COSName key = parseCOSName();
                COSBase value = parseCOSDictionaryValue();
                skipSpaces();
                if( ((char)pdfSource.peek()) == 'd' )
                {
                    //if the next string is 'def' then we are parsing a cmap stream
View Full Code Here

     *
     * @throws IOException If there is an error reading from the stream.
     */
    protected COSName parseCOSName() throws IOException
    {
        COSName retval = null;
        int c = pdfSource.read();
        if( (char)c != '/')
        {
            throw new IOException("expected='/' actual='" + (char)c + "'-" + c + " " + pdfSource );
        }
View Full Code Here

     *
     * @throws IOException If there is an error processing this operator.
     */
    public void process(PDFOperator operator, List<COSBase> arguments) throws IOException
    {
        COSName name = (COSName) arguments.get( 0 );

        Map<String,PDXObject> xobjects = context.getXObjects();
        PDXObject xobject = (PDXObject) xobjects.get(name.getName());
        if (context instanceof PDFMarkedContentExtractor)
        {
            ((PDFMarkedContentExtractor) context).xobject(xobject);
        }

View Full Code Here

        {
            writtenObjects.add( obj );
            if(obj instanceof COSDictionary)
            {
                COSDictionary dict = (COSDictionary)obj;
                COSName item = (COSName)dict.getItem(COSName.TYPE);
                if (COSName.SIG.equals(item) || COSName.DOC_TIME_STAMP.equals(item))
                {
                    reachedSignature = true;
                }
            }
View Full Code Here

        {
            COSDictionary trailer = doc.getTrailer();
            trailer.setLong(COSName.PREV, doc.getStartXref());
            if (hybridPrev != -1)
            {
                COSName xrefStm = COSName.XREF_STM;
                trailer.removeItem(xrefStm);
                trailer.setLong(xrefStm, getStartxref());
            }
            addXRefEntry(COSWriterXRefEntry.getNullEntry());
   
View Full Code Here

TOP

Related Classes of org.apache.pdfbox.cos.COSName

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.