New to Telerik Document ProcessingStart a free 30-day trial

Change Flow Document Properties when converting to PDF

Updated on Apr 24, 2026
VersionProductAuthor
2020.1.218RadWordsProcessingDimitar Karamfilov

Description

The RadWordsProcessing library allows you to convert various documents formats (docx, rtf, txt, html) to PDF. When converting you may need to modify the document properties (page size or orientation, margins).

Solution

Change the properties of the RadFlowDocument.

Change the RadFlowDocument properties while exporting.

csharp
    HtmlFormatProvider htmlProvider = new HtmlFormatProvider();
    RadFlowDocument document = htmlProvider.Import(html);

    foreach (var section in document.Sections)
    {
        section.PageMargins = new Padding(150);
        section.PageSize = PaperTypeConverter.ToSize(PaperTypes.A4);
        section.Rotate(PageOrientation.Landscape);
    }

    PdfFormatProvider pdfProvider = new PdfFormatProvider();
    
    using (Stream output = File.Create(save))
    {              
        pdfProvider.Export(document, output);
    }
In this article
DescriptionSolution
Not finding the help you need?
Contact Support