ClassPdfStreamWriter
Streams a PDF document to an output Stream, letting you write pages sequentially without holding the full document in memory.
Definition
Namespace:Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Streaming
Assembly:Telerik.Windows.Documents.Fixed.dll
Syntax:
public sealed class PdfStreamWriter : IDisposable
Inheritance: objectPdfStreamWriter
Implements:
Constructors
PdfStreamWriter(Stream)
Creates a PDF stream writer over the specified stream.
Declaration
public PdfStreamWriter(Stream stream)
Parameters
stream
The stream.
PdfStreamWriter(Stream, bool)
Creates a PDF stream writer and optionally leaves the output stream open when disposed.
Declaration
public PdfStreamWriter(Stream stream, bool leaveStreamOpen)
Parameters
stream
The stream.
leaveStreamOpen
Boolean value indicating whether or not to close the stream after PdfStreamWriter instance is disposed.
Properties
Settings
Settings that control how the PDF is produced during streaming (compression, image quality, metadata).
Declaration
public PdfStreamWriterSettings Settings { get; }
Property Value
Methods
BeginPage(Rect, Rect, Rotation)
Begins a new page with the specified media box, crop box, and rotation and returns a writer for its content.
Declaration
public PdfPageStreamWriter BeginPage(Rect mediaBox, Rect cropBox, Rotation rotation)
Parameters
mediaBox
Rect
Defines the boundaries of the physical medium on which the page is intended to be displayed or printed.
cropBox
Rect
Defines the boundaries of the visible region of the page. When the page is displayed or printed, its contents are to be clipped (cropped) to this rectangle.
rotation
The rotation.
Returns
The page stream.
BeginPage(Size)
Begins a new page with the specified size and returns a writer for its content.
Declaration
public PdfPageStreamWriter BeginPage(Size pageSize)
Parameters
pageSize
Size
Size of the page.
Returns
The page stream.
BeginPage(Size, Rotation)
Begins a new page with the specified size and rotation and returns a writer for its content.
Declaration
public PdfPageStreamWriter BeginPage(Size pageSize, Rotation rotation)
Parameters
pageSize
Size
Size of the page.
rotation
The rotation.
Returns
The page stream.
Dispose()
Finalizes the document, writes all pending objects, and disposes resources; closes the stream unless leaveStreamOpen is true.
Declaration
public void Dispose()
Exceptions
Thrown when one or more PdfFileSource instances that were used with this writer have not been disposed before disposing the writer. Always dispose PdfFileSource instances before disposing PdfStreamWriter to avoid empty pages and unexpected results.
Implements
WritePage(PdfPageSource)
Writes a page from a PdfPageSource into the output stream and finalizes it.
Declaration
public void WritePage(PdfPageSource pageSource)
Parameters
pageSource
The page source.
WritePage(RadFixedPage)
Writes a RadFixedPage into the output stream and finalizes it.
Declaration
public void WritePage(RadFixedPage page)
Parameters
page
The page.
~PdfStreamWriter()
Finalizes an instance of the PdfStreamWriter class. This finalizer ensures that unmanaged resources are properly released if Dispose was not called explicitly.
Declaration
protected ~PdfStreamWriter()