←Select platform

SetViewPerspective Method

Summary

Applies transformation on the specified pages.

Syntax
C#
C++/CLI
Python
public void SetViewPerspective( 
   RasterViewPerspective viewPerspective, 
   int firstPageNumber, 
   int lastPageNumber 
) 
public:  
   void SetViewPerspective( 
      RasterViewPerspective^ viewPerspective, 
      Int32 firstPageNumber, 
      Int32 lastPageNumber 
   ) 
def SetViewPerspective(self,viewPerspective,firstPageNumber,lastPageNumber): 

Parameters

viewPerspective

View perspective value to apply.

1-based first page number in the document. This value must be greater than or equal to 1.

lastPageNumber

1-based last page number in the document. This value must be greater or equal to

firstPageNumber. A value of -1 means the last page in the document.
Remarks

This method loops through all the pages specified and sets the value of DocumentPage.ViewPerspective to viewPerspective. For more information, refer to Document Page Transformation.

Example
C#
using Leadtools; 
using Leadtools.Document; 
using Leadtools.Document.Converter; 
using Leadtools.Document.Writer; 
 
 
public void DocumentPagesSetViewPerspectiveExample() 
{ 
   var documentUri = new Uri("https://demo.leadtools.com/images/pdf/leadtools.pdf"); 
   string documentFile = Path.Combine(LEAD_VARS.ImagesDir, "PagesModified.pdf"); 
 
   // Load this document  
   var loadDocumentOptions = new LoadDocumentOptions(); 
   using (var document = DocumentFactory.LoadFromUri(documentUri, loadDocumentOptions)) 
   { 
      using (var documentConverter = new DocumentConverter()) 
      { 
         // Documents are read-only by default and we cannot modify them. Fix that 
         document.IsReadOnly = false; 
 
         // This document has 5 pages 
         DocumentPages pages = document.Pages; 
         // SetViewPerspective on all of the pages 
         pages.SetViewPerspective(RasterViewPerspective.BottomLeft270, 1, 5); 
 
         var jobData = new DocumentConverterJobData(); 
         // The loaded document is our input  
         jobData.Document = document; 
         // We want PDF as output  
         jobData.DocumentFormat = DocumentFormat.Pdf; 
         // Into this file  
         jobData.OutputDocumentFileName = documentFile; 
 
         var job = documentConverter.Jobs.CreateJob(jobData); 
         documentConverter.Jobs.RunJob(job); 
      } 
   } 
   // Show the result 
   Process.Start(documentFile); 
} 
 
static class LEAD_VARS 
{ 
   public const string ImagesDir = @"C:\LEADTOOLS22\Resources\Images"; 
} 
Requirements

Target Platforms

Help Version 22.0.2023.4.21
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

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