This is a migrated thread and some comments may be shown as answers.
PDF Margins and Orientation
1 Answer 131 Views
This is a migrated thread and some comments may be shown as answers.
Trey
Top achievements
Rank 2
Trey asked on 28 Sep 2015, 05:02 PM

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?

1 Answer, 1 is accepted

Sort by
0
Tanya
Telerik team
answered on 01 Oct 2015, 11:42 AM
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.

Regards,
Tanya
Telerik
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
Asked by
Trey
Top achievements
Rank 2
Answers by
Tanya
Telerik team
Share this question
or