This is a migrated thread and some comments may be shown as answers.

Rotate pdf command

1 Answer 39 Views
PdfViewer
This is a migrated thread and some comments may be shown as answers.
n/a
Top achievements
Rank 1
n/a asked on 29 Oct 2019, 02:27 PM
Is it now or will be, in future, possible to add rotate pdf command?

1 Answer, 1 is accepted

Sort by
0
Didi
Telerik team
answered on 30 Oct 2019, 05:23 AM

Hi Maciej,

At the moment the PdfViewer does not have a built-in functionality that will allow you to view the pages of the pdf document rotated. We have a feature request logged in our Feedback portal. You can follow and vote for the item at the link below:

https://feedback.telerik.com/xamarin/1399978-pdfviewer-ability-to-display-the-pdf-content-rotated-clockwise-or-counterclockwise

However, you can easily get the results you are after by simply setting the desired orientation before setting the Source of the PdfViewer. Here is one way you can do this:

PdfFormatProvider provider = new PdfFormatProvider();
using (Stream stream = ....)
{
  RadFixedDocument doc = provider.Import(stream);
  doc.Pages[0].Rotation = Telerik.Windows.Documents.Fixed.Model.Data.Rotation.Rotate90;
  this.pdfViewer.Source = doc;
}

You can iterate all pages of the document and set the appropriate rotation based on some logic, for example you can take a look at the Size property of the page to determine its orientation.

Regards,
Didi
Progress 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
Tags
PdfViewer
Asked by
n/a
Top achievements
Rank 1
Answers by
Didi
Telerik team
Share this question
or