[]
        
(Showing Draft Content)

GrapeCity.Documents.Pdf.Writer.PdfDocStreamWriter

Class PdfDocStreamWriter

Namespace
GrapeCity.Documents.Pdf.Writer
Assembly
GcDocs.Pdf.dll

PDF writer used to build PDF document content.

public class PdfDocStreamWriter : PdfStreamWriterBase
Inheritance
object
PdfDocStreamWriter
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()

Properties

CurrentObjID

Gets the ID of the object that is currently being written.

public override PdfObjID CurrentObjID { get; }

Property Value

PdfObjID

Methods

AddDictEntry(PdfName, IPdfObject)

Adds a dictionary entry with value representing GrapeCity.Documents.Pdf.Spec.IPdfObject, see Write(IPdfObject).

public override void AddDictEntry(PdfName key, IPdfObject value)

Parameters

key PdfName
value GrapeCity.Documents.Pdf.Spec.IPdfObject

AddDictEntryRaw(PdfName, string)

Adds a dictionary entry with "raw" value, passed value is written as is, each char converted to byte using (byte)value[...].

public void AddDictEntryRaw(PdfName key, string value)

Parameters

key PdfName
value string

BeginObj(PdfObjID, string)

Starts writing a new PDF indirect object with specified ID.

public void BeginObj(PdfObjID objID, string objectComment)

Parameters

objID PdfObjID
objectComment string

BeginObj(PdfObjID)

Starts writing a new PDF indirect object with specified ID.

public virtual void BeginObj(PdfObjID objID)

Parameters

objID PdfObjID

BeginObj(int, string)

Starts writing a new PDF indirect object with specified ID.

public void BeginObj(int objID, string objectComment)

Parameters

objID int
objectComment string

BeginObj(int)

Starts writing a new PDF indirect object with specified ID.

public void BeginObj(int objID)

Parameters

objID int

BeginObj(string)

Generates an ID and starts writing a new PDF indirect object, returns the generated ID.

public int BeginObj(string objectComment)

Parameters

objectComment string

Returns

int

BeginStream(out long, out Stream, out bool)

Starts a stream, PDF stream dictionary should be already started. Should be enclosed with EndStream(long).

public void BeginStream(out long offset, out Stream stream, out bool disposeStream)

Parameters

offset long
stream System.IO.Stream
disposeStream bool

EndObj()

Ends writing a PDF indirect object started with one of BeginObj(...) methods.

public void EndObj()

EndStream(long)

Ends a PDF stream started with BeginStream(out long, out Stream, out bool).

public void EndStream(long offset)

Parameters

offset long

EndStream(Stream, PdfName, IPdfDict, bool, EncryptionStreamType, bool)

Ends writing a PDF indirect object started with one of BeginObj(...) methods. If stream is not empty then writes PDF stream, including "Length" and "Filter" dictionary properties.

public void EndStream(Stream stream, PdfName filterName, IPdfDict filterParams, bool useCompression = true, EncryptionStreamType est = EncryptionStreamType.Default, bool forceLengthAsDirectValue = false)

Parameters

stream System.IO.Stream

The data to write.

filterName PdfName

The PDF filter used to decode stream data, can be null (no filter).

filterParams IPdfDict

The parameters of PDF filter, can be null.

useCompression bool

Indicates whether to compress data if compression specified for the GcPdfDocument.

est EncryptionStreamType

The stream type, indicates whether to encrypt data.

forceLengthAsDirectValue bool

If true then Length entry will be written as DIRECT VALUE.

Write(IPdfObject)

Writes the GrapeCity.Documents.Pdf.Spec.IPdfObject object if value is indirect object then reference to this object will be written otherwise GrapeCity.Documents.Pdf.Spec.IPdfObject.Write(GrapeCity.Documents.Pdf.Writer.PdfStreamWriterBase) will be called to write value representing an object. If value is null or GrapeCity.Documents.Pdf.Spec.IPdfObject.Empty is true then PDF NULL value will be written.

public override void Write(IPdfObject value)

Parameters

value GrapeCity.Documents.Pdf.Spec.IPdfObject

WriteComment(string)

Writes a comment string to the stream.

public void WriteComment(string comment)

Parameters

comment string

WriteCrossRefTableHeader(int, int, bool)

Writes start of "xref" table.

public void WriteCrossRefTableHeader(int firstObjectID, int objectCount, bool writeZeroEntry)

Parameters

firstObjectID int
objectCount int
writeZeroEntry bool

WriteCrossRefTableItem(int)

Writes item of "xref" table.

public void WriteCrossRefTableItem(int objID)

Parameters

objID int

WriteCrossRefTableTrailer(long, int, long, int, int, bool, bool, int)

Writes trailer of "xref" table.

public void WriteCrossRefTableTrailer(long crossRefTableOffset, int size, long prevCrossReferenceEntryOffset, int rootID, int encryptionID, bool writeDocumentInfo, bool writeDocID, int minFileSize = 0)

Parameters

crossRefTableOffset long
size int
prevCrossReferenceEntryOffset long
rootID int
encryptionID int
writeDocumentInfo bool
writeDocID bool
minFileSize int