Table of Contents

Interface ITokenWriter

Namespace
UglyToad.PdfPig.Writer
Assembly
UglyToad.PdfPig.dll

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 IndirectReference

The object representing the catalog dictionary which is referenced from the trailer dictionary.

outputStream Stream

The 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 long

Object number of the indirect object.

generation int

Generation of the indirect object.

data byte[]

Pre-serialized object contents.

outputStream Stream

The 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)

Parameters

token IToken

The token to write to the stream.

outputStream Stream

The stream to write the token to.