[]
PDF writer used to build PDF document content.
public class PdfDocStreamWriter : PdfStreamWriterBase
Gets the ID of the object that is currently being written.
public override PdfObjID CurrentObjID { get; }
Adds a dictionary entry with value representing IPdfObject, see Write(IPdfObject).
public override void AddDictEntry(PdfName key, IPdfObject value)
key
PdfNamevalue
IPdfObjectAdds 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)
Starts writing a new PDF indirect object with specified ID.
public virtual void BeginObj(PdfObjID objID, bool useObjectStreamsIfPossible)
Starts writing a new PDF indirect object with specified ID.
public void BeginObj(PdfObjID objID, string objectComment, bool useObjectStreamsIfPossible)
Starts writing a new PDF indirect object with specified ID.
public void BeginObj(int objID, bool useObjectStreamsIfPossible)
Starts writing a new PDF indirect object with specified ID.
public void BeginObj(int objID, string objectComment, bool useObjectStreamsIfPossible)
Generates an ID and starts writing a new PDF indirect object, returns the generated ID.
public int BeginObj(string objectComment, bool useObjectStreamsIfPossible)
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)
Ends writing a PDF indirect object started with one of BeginObj(...) methods.
public void EndObj()
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)
stream
StreamThe data to write.
filterName
PdfNameThe PDF filter used to decode stream data, can be null (no filter).
filterParams
IPdfDictThe parameters of PDF filter, can be null.
useCompression
boolIndicates whether to compress data if compression specified for the GcPdfDocument.
est
EncryptionStreamTypeThe stream type, indicates whether to encrypt data.
forceLengthAsDirectValue
boolIf true then Length entry will be written as DIRECT VALUE.
Ends a PDF stream started with BeginStream(out long, out Stream, out bool).
public void EndStream(long offset)
offset
longWrites the IPdfObject object
if value
is indirect object then reference to this object will be written
otherwise Write(PdfStreamWriterBase) will be
called to write value representing an object.
If value
is null or Empty is true
then PDF NULL value will be written.
public override void Write(IPdfObject value)
value
IPdfObjectWrites a comment string to the stream.
public void WriteComment(string comment)
comment
stringWrites start of "xref" table.
public void WriteCrossRefTableHeader(int firstObjectID, int objectCount, bool writeZeroEntry)
Writes item of "xref" table.
public void WriteCrossRefTableItem(int objID)
objID
intWrites trailer of "xref" table.
public void WriteCrossRefTableTrailer(long crossRefTableOffset, int size, long prevCrossReferenceEntryOffset, int rootID, int encryptionID, bool writeDocumentInfo, bool writeDocID, int minFileSize = 0)