Class
PdfStreamWriter

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:

cs-api-definition
public sealed class PdfStreamWriter : IDisposable

Inheritance: objectPdfStreamWriter

Implements: IDisposable

Constructors

PdfStreamWriter(Stream)

Creates a PDF stream writer over the specified stream.

Declaration

cs-api-definition
public PdfStreamWriter(Stream stream)

Parameters

stream

Stream

The stream.

PdfStreamWriter(Stream, bool)

Creates a PDF stream writer and optionally leaves the output stream open when disposed.

Declaration

cs-api-definition
public PdfStreamWriter(Stream stream, bool leaveStreamOpen)

Parameters

stream

Stream

The stream.

leaveStreamOpen

bool

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

cs-api-definition
public PdfStreamWriterSettings Settings { get; }

Property Value

PdfStreamWriterSettings

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

cs-api-definition
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

Rotation

The rotation.

Returns

PdfPageStreamWriter

The page stream.

BeginPage(Size)

Begins a new page with the specified size and returns a writer for its content.

Declaration

cs-api-definition
public PdfPageStreamWriter BeginPage(Size pageSize)

Parameters

pageSize

Size

Size of the page.

Returns

PdfPageStreamWriter

The page stream.

BeginPage(Size, Rotation)

Begins a new page with the specified size and rotation and returns a writer for its content.

Declaration

cs-api-definition
public PdfPageStreamWriter BeginPage(Size pageSize, Rotation rotation)

Parameters

pageSize

Size

Size of the page.

rotation

Rotation

The rotation.

Returns

PdfPageStreamWriter

The page stream.

Dispose()

Finalizes the document, writes all pending objects, and disposes resources; closes the stream unless leaveStreamOpen is true.

Declaration

cs-api-definition
public void Dispose()

Exceptions

InvalidOperationException

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 IDisposable.Dispose()

WritePage(PdfPageSource)

Writes a page from a PdfPageSource into the output stream and finalizes it.

Declaration

cs-api-definition
public void WritePage(PdfPageSource pageSource)

Parameters

pageSource

PdfPageSource

The page source.

WritePage(RadFixedPage)

Writes a RadFixedPage into the output stream and finalizes it.

Declaration

cs-api-definition
public void WritePage(RadFixedPage page)

Parameters

page

RadFixedPage

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

cs-api-definition
protected ~PdfStreamWriter()