PDF Margins and Orientation

2 posts, 0 answers
  1. Trey
    Trey avatar
    36 posts
    Member since:
    Dec 2006

    Posted 28 Sep 2015 Link to this post

    Could an example be provided on how to create a PDF and set the Margins and Orientation for WinForms?

    And if this involves the orientation involves use of PageRotation, could you please include how to rotate the text to match the rotation?

  2. Tanya
    Tanya avatar
    897 posts

    Posted 01 Oct 2015 Link to this post

    Hello Trey,

    You could use the API of RadFixedDocumentEditor to set the margins and rotation of a page. Please, refer to the snippet below, which demonstrates how you could achieve this:
    RadFixedDocument document = new RadFixedDocument();
    using (RadFixedDocumentEditor editorDocument = new RadFixedDocumentEditor(document))
        editorDocument.SectionProperties.PageMargins = new Padding(300);
        editorDocument.SectionProperties.PageRotation = Rotation.Rotate90;       
        editorDocument.InsertRun("Test Run.");
        editorDocument.InsertLine("Some longer test sentence.");
        editorDocument.InsertRun("Another Run.");

    Using the PageRotation property of the SectionProperties object, the text will be automatically rotated with the page.

    Hope this is helpful.

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top