New to Telerik Document ProcessingStart a free 30-day trial

PdfPageStreamWriter

Updated on Jun 3, 2026

The PdfPageStreamWriter class provides an API that allows you to write and position content in the current page.

Using PdfPageStreamWriter

Create a PdfPageStreamWriter Instance

Obtain an instance of the PdfPageStreamWriter class by using the BeginPage() method of PdfStreamWriter.

Example 1: Instantiate PdfPageStreamWriter

C#
using (PdfStreamWriter writer = new PdfStreamWriter(File.OpenWrite(resultDocument)))
{
    Size size = new Size(700, 1200);
    Rotation rotation = Rotation.Rotate270;

    using (PdfPageStreamWriter pageWriter = writer.BeginPage(size, rotation))
    {
        //Use the pageWriter object to fill the content of the page.
    }
}

You can find an example of how to use the PdfPageStreamWriter class in the Manipulate Pages example in the XAML SDK repository on GitHub.

PdfStreamWriter also exposes an additional overload that allows you to keep the stream open after disposing the writer instance. Pass true as the value for the second constructor parameter (leaveStreamOpen).

PdfPageStreamWriter inherits from IDisposable. Ensure the object is disposed when you are done with it. The best way to handle this is to wrap it in a using statement.

PdfPageStreamWriter Members

The members of the class allow you to set several properties of the document page and write new content:

MemberDescription
RotationA read-only property of type Rotation. Keeps the rotation of the current page.
SizeA read-only property of type Size. Keeps the size of the current page.
WriteContent()Writes content to the current PDF page stream. Overloads accept content from PdfPageSource or RadFixedPage.
ContentPositionA property of type IPosition that specifies the position of the next page content written with WriteContent().
SaveContentPosition()Saves the current IPosition values. Returns an IDisposable that restores the position when disposed.

See Also