←Select platform

RotatePages Method

Summary

Rotates one or more pages with the specified value.

Syntax
C#
C++/CLI
public void RotatePages( 
   IEnumerable<int> pageNumbers, 
   int angle 
) 
public:  
   void RotatePages( 
      IEnumerable<Int32>^ pageNumbers, 
      Int32 angle 
   ) 

Parameters

pageNumbers

Page numbers to rotate. This should be one or more item with 1-based page numbers. Use null to rotate all the pages in the document viewer.

angle

Angles in degrees. Must be in 90 degrees increment. The rotation is performed clockwise for positive values and counter-clockwise for negative values.

Remarks

This method performs the following:

For each page number specified in pageNumbers.

  1. Finds the corresponding DocumentPage object and calls the DocumentPage.Rotate method.

  2. Rotates the corresponding AnnContainer if any.

  3. Resets the text of the page.

The Operation event will occur for each page with the DocumentViewerOperation set to PageRotate.

Example

Start with the example created in DocumentViewer, remove all the code in the Example function and add the code below.

When the user clicks the Example button, we rotate the current active page by 90 degrees. Clicking the example button again will rotate the page by another 90 degrees.

C#
using Leadtools; 
using Leadtools.Controls; 
using Leadtools.Document; 
using Leadtools.Document.Viewer; 
using Leadtools.Codecs; 
using Leadtools.Caching; 
using Leadtools.Annotations.Engine; 
using Leadtools.Ocr; 
 
 
int pageNumber = _documentViewer.CurrentPageNumber; 
_documentViewer.RotatePages(new int[] { pageNumber }, 90); 
Help Version 23.0.2024.2.29
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Document.Viewer.WinForms Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.