How to C#: Tiff
Using Tiff SDK for C#.NET
Move Tiff Page Position
Move Tiff Page Position
  |  
Home ›› XDoc.Tiff ›› C# Tiff: Sort Tiff Pages

C# TIFF - Sort TIFF File Pages Order in C#.NET


Reorder, Rearrange and Sort TIFF Document Pages in C#.NET Application




C# TIFF Page Sorting Overview



RasterEdge XDoc.Tiff for .NET is powerful enough to enable C# users to reorder and rearrange multi-page Tiff file flexibly. Using this C#.NET Tiff image management library, you can easily change and move the position of any two or more Tiff file pages or make a totally new order for all Tiff pages.


Related .net document control helps:
asp.net document viewer: EdgeDoc ASP.NET Document Viewer C# Control: Open, view, annotate, redact, convert documents online using ASP.NET Web Con...
asp.net edit pdf text: ASP.NET PDF Text Edit Control: online edit PDF text content using C# ASP.NET
asp.net dnn document viewer: DNN Document Viewer Control: view, annotate, redact, convert documents in dotnetnuke ASP.NET
view document asp.net: View multiple document formats in ASP.NET, MVC, Ajax, Azure using C# control
asp.net mvc pdf editor: ASP.NET MVC PDF Editor: view, annotate, redact, edit PDF document in C# ASP.NET MVC
asp.net excel document viewer: ASP.NET Excel Document Viewer in C# Control: view office excel files online in ASP.NET web applications
asp.net iis document viewer: C# HTML5 Viewer: Deployment on IIS


RasterEdge .NET Tiff processing SDK also offers C# users with other fully developed Tiff imaging technologies, such as Tiff image viewing, creating, editing, converting, saving, etc. In the following part, you will see a complete C# programming sample for moving the position of Tiff document pages.




DLLs: Sort TIFF File Pages Order Using C#



In order to run the following conversion code, please do as follows:


Add references;


  RasterEdge.Imaging.Basic.dll


  RasterEdge.Imaging.Basic.Codec.dll


  RasterEdge.Imaging.Drawing.dll


  RasterEdge.XDoc.Processing.dll


  RasterEdge.Imaging.Raster.dll


  RasterEdge.Imaging.Raster.Core.dll


  RasterEdge.Imaging.Font.dll


  RasterEdge.XDoc.TIFF.dll


Use corresponding namespaces;


  using RasterEdge.Imaging.Basic;


  using RasterEdge.XDoc.TIFF;


Note: When you get the error "Could not load file or assembly 'RasterEdge.Imaging.Basic' or any other assembly or one of its dependencies. An attempt to load a program with an incorrect format", please check your configure as follows:


If you are using x64 libraries/dlls, Right click the project -> Properties -> Build -> Platform target: x64.


If using x86, the platform target should be x86.




Reorder TIFF Pages in C#.NET Application



This part is mainly designed to show C# users how to easily implement Tiff document pages sorting. The sample Tiff image file will be rearranged with a new order.




// Load a Tiff file.
            TIFFDocument doc = new TIFFDocument(@"C:\demo1.tif");
            if (null == doc) throw new Exception("Fail to load the file !");

            // Sort the Tiff file pages with a new order (4, 3, 2, 1, 0).      
            int[] pagePosition = new int[] { 4, 3, 2, 1, 0 };
            doc.SortPage(pagePosition);
            doc.Save(@"C:\sort.tif");





Swap TIFF Pages in C#.NET Application



This part is mainly designed to show C# users how to easily swap Tiff document pages. The sample Tiff image file pages will be rearranged with a new position.




// Load a Tiff file.
            TIFFDocument doc = new TIFFDocument(@"C:\demo1.tif");
            if (null == doc) throw new Exception("Fail to load the file !");

            //Swap the third and fifth pages.
            doc.SwapTwoPages(2, 4);
            doc.Save(@"C:\swap.tif");



public override void SortPage(int[] orderPageIdxs)

Description:
Sort the TIFF file pages with specified order;

Parameters:
public override void SwapTwoPages(int pageIdxF, int pageIdxB)

Description:
Swap two specified pages’ place

Parameters: