public class IncrementablePDDocument extends Object implements Closeable
| Modifier and Type | Field and Description |
|---|---|
org.sejda.sambox.input.COSParser |
parser |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
COSDictionary |
encryptionDictionary() |
byte[] |
encryptionKey() |
COSObjectKey |
highestExistingReference() |
PDDocument |
incremented() |
InputStream |
incrementedAsStream() |
boolean |
modified(COSObjectable modified)
Adds the given object as modified, this object will be written as part of the incremental update.
|
void |
newIndirect(COSObjectable newObject)
Adds the given object to the set of the new indirect objects.
|
Set<COSBase> |
newIndirects() |
void |
replace(IndirectCOSObjectIdentifier toReplace,
COSObjectable replacement)
Replaces the object with the given
IndirectCOSObjectIdentifier during the incremental update |
List<IndirectCOSObjectReference> |
replacements() |
void |
requireMinVersion(String version)
Sets the version for this document if not at the minimum version required
|
void |
setVersion(String newVersion) |
FileTrailer |
trailer() |
void |
writeTo(File file,
WriteOption... options)
Writes the document to the given
File. |
void |
writeTo(OutputStream out,
WriteOption... options)
Writes the document to the given
OutputStream. |
void |
writeTo(String filename,
WriteOption... options)
Writes the document to the file corresponding the given file name.
|
void |
writeTo(WritableByteChannel channel,
WriteOption... options)
Writes the document to the given
WritableByteChannel. |
public PDDocument incremented()
public FileTrailer trailer()
public InputStream incrementedAsStream() throws IOException
IOExceptionpublic COSObjectKey highestExistingReference()
public void replace(IndirectCOSObjectIdentifier toReplace, COSObjectable replacement)
IndirectCOSObjectIdentifier during the incremental updatetoReplace - replacement - public boolean modified(COSObjectable modified)
modified - COSBase was added, false if not. In case where false is returned, the COSBase
doesn't have an id, meaning it's not written as indirect object in the original document but it's written as
direct object. In this case we have to call IncrementablePDDocument#modified(COSBase) on the first
indirect parent because incremental updates are meant to replace indirect references.public void newIndirect(COSObjectable newObject)
newObject - public List<IndirectCOSObjectReference> replacements()
IndirectCOSObjectReference to be written as replacements for this incremental updatepublic Set<COSBase> newIndirects()
public COSDictionary encryptionDictionary()
public byte[] encryptionKey()
public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic void writeTo(File file, WriteOption... options) throws IOException
File. The document is closed once written.file - options - IOExceptionpublic void writeTo(String filename, WriteOption... options) throws IOException
filename - options - IOExceptionpublic void writeTo(WritableByteChannel channel, WriteOption... options) throws IOException
WritableByteChannel. The document is closed once written.channel - options - IOExceptionpublic void writeTo(OutputStream out, WriteOption... options) throws IOException
OutputStream. The document is closed once written.out - options - IOExceptionpublic void requireMinVersion(String version)
version - public void setVersion(String newVersion)
Copyright © 2019 sejda. All rights reserved.