Example usage for org.apache.pdfbox.cos COSName DOC_TIME_STAMP

List of usage examples for org.apache.pdfbox.cos COSName DOC_TIME_STAMP

Introduction

In this page you can find the example usage for org.apache.pdfbox.cos COSName DOC_TIME_STAMP.

Prototype

COSName DOC_TIME_STAMP

To view the source code for org.apache.pdfbox.cos COSName DOC_TIME_STAMP.

Click Source Link

Usage

From source file:com.aaasec.sigserv.csspsupport.pdfbox.modifications.CsCOSWriter.java

License:Apache License

/**
 * This will write a COS object.//  w  w  w .j ava  2 s.  c o  m
 *
 * @param obj The object to write.
 *
 * @throws COSVisitorException If there is an error visiting objects.
 */
public void doWriteObject(COSBase obj) throws COSVisitorException {
    try {
        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;
            }
        }

        // find the physical reference
        currentObjectKey = getObjectKey(obj);
        // add a x ref entry
        addXRefEntry(new COSWriterXRefEntry(getStandardOutput().getPos(), obj, currentObjectKey));
        // write the object
        getStandardOutput().write(String.valueOf(currentObjectKey.getNumber()).getBytes("ISO-8859-1"));
        getStandardOutput().write(SPACE);
        getStandardOutput().write(String.valueOf(currentObjectKey.getGeneration()).getBytes("ISO-8859-1"));
        getStandardOutput().write(SPACE);
        getStandardOutput().write(OBJ);
        getStandardOutput().writeEOL();
        obj.accept(this);
        getStandardOutput().writeEOL();
        getStandardOutput().write(ENDOBJ);
        getStandardOutput().writeEOL();
    } catch (IOException e) {
        throw new COSVisitorException(e);
    }
}

From source file:eu.europa.esig.dss.pdf.pdfbox.PdfBoxDocTimeStampService.java

License:Open Source License

@Override
protected COSName getType() {
    return COSName.DOC_TIME_STAMP;
}