[]
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 GrapeCity.Documents.Pdf.Spec.IPdfObject, see Write(IPdfObject).
public override void AddDictEntry(PdfName key, IPdfObject value)
key
PdfNamevalue
GrapeCity.Documents.Pdf.Spec.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)
key
PdfNamevalue
stringStarts writing a new PDF indirect object with specified ID.
public void BeginObj(PdfObjID objID, string objectComment)
objID
PdfObjIDobjectComment
stringStarts writing a new PDF indirect object with specified ID.
public virtual void BeginObj(PdfObjID objID)
objID
PdfObjIDStarts writing a new PDF indirect object with specified ID.
public void BeginObj(int objID, string objectComment)
objID
intobjectComment
stringStarts writing a new PDF indirect object with specified ID.
public void BeginObj(int objID)
objID
intGenerates an ID and starts writing a new PDF indirect object, returns the generated ID.
public int BeginObj(string objectComment)
objectComment
stringStarts 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)
offset
longstream
System.IO.StreamdisposeStream
boolEnds writing a PDF indirect object started with one of BeginObj(...) methods.
public void EndObj()
Ends a PDF stream started with BeginStream(out long, out Stream, out bool).
public void EndStream(long offset)
offset
longEnds 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
System.IO.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.
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)
value
GrapeCity.Documents.Pdf.Spec.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)
firstObjectID
intobjectCount
intwriteZeroEntry
boolWrites 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)
crossRefTableOffset
longsize
intprevCrossReferenceEntryOffset
longrootID
intencryptionID
intwriteDocumentInfo
boolwriteDocID
boolminFileSize
int