Interface ITokenWriter
Writes any type of IToken to the corresponding PDF document format output.
public interface ITokenWriter
Methods
WriteCrossReferenceTable(IReadOnlyDictionary<IndirectReference, long>, IndirectReference, Stream, IndirectReference?)
Writes a valid single section cross-reference (xref) table plus trailer dictionary to the output for the set of object offsets.
void WriteCrossReferenceTable(IReadOnlyDictionary<IndirectReference, long> objectOffsets, IndirectReference catalogToken, Stream outputStream, IndirectReference? documentInformationReference)
Parameters
objectOffsets
IReadOnlyDictionary<IndirectReference, long>The byte offset from the start of the document for each object in the document.
catalogToken
IndirectReferenceThe object representing the catalog dictionary which is referenced from the trailer dictionary.
outputStream
StreamThe output stream to write to.
documentInformationReference
IndirectReference?The object reference for the document information dictionary if present.
WriteObject(long, int, byte[], Stream)
Writes pre-serialized token as an object token to the output stream.
void WriteObject(long objectNumber, int generation, byte[] data, Stream outputStream)
Parameters
objectNumber
longObject number of the indirect object.
generation
intGeneration of the indirect object.
data
byte[]Pre-serialized object contents.
outputStream
StreamThe stream to write the token to.
WriteToken(IToken, Stream)
Writes the given input token to the output stream with the correct PDF format and encoding including whitespace and line breaks as applicable.
void WriteToken(IToken token, Stream outputStream)