How to C#: Tiff
Using Tiff SDK for C#.NET
Insert Pages into Tiff File
Insert Pages into Tiff File
  |  
Home ›› XDoc.Tiff ›› C# Tiff: Insert Tiff Page

C# TIFF - Insert Page to TIFF File in C#.NET


Sample C# Code for Adding a New Page to TIFF Document




C#.NET TIFF Page Inserting Overview



.NET Tiff processing control, XDoc.Tiff for .NET SDK library, provides fully-functional options for C#.NET developers to manipulate & manage the pages of Tiff document file. This page mainly talks about how to add a new page and pages to Tiff document by using Tiff page insertion API of C#.NET Tiff imaging SDK.


Related .net document control helps:
asp.net view excel in browser: ASP.NET Excel Viewer in C# Control (MVC & WebForms): view Office Excel document in web browser.
asp.net mvc pdf editor control: ASP.NET MVC PDF Viewer & Editor: view, annotate, redact, edit PDF document in C# ASP.NET MVC
asp.net dicom web viewer: ASP.NET Dicom Document Viewer Control: view, annotate dicom imaging files online in ASP.NET
asp.net annotate pdf control: ASP.NET Annotate PDF Control: annotate, comment, markup PDF document online using ASP.NET C#
powerpoint viewer asp.net mvc: ASP.NET PowerPoint Document Viewer Control (MVC & WebForms): view ppt, pptx files online in C# using ASP.NET
asp.net edit pdf text control: ASP.NET PDF Text Edit Control: online edit PDF text content using C# ASP.NET
asp.net pdf viewer control free: ASP.NET PDF Viewer Control: view, navigate, zoom Adobe PDF document in C# ASP.NET


As an excellent image and document viewing and processing provider, RasterEdge is aimed at offering comprehensive and easy-to-use imaging toolkits for developers and end users. RasterEdge XDoc.Tiff for .NET can be easily integrated into commonly used Visual Studio .NET applications, such as Visual C#.NET, Visual Basic .NET, ASP.NET and .NET Windows Forms applications.


In addition to Tiff file page inserting, RasterEdge .NET Tiff processing SDK still empowers developers and end users to do Tiff image rotating, deleting, reordering, extracting, etc. like listed below by using C#.NET class library. If you want to get the overall guide for Tiff page processing, please see Tiff page processing guide in C#.NET.


C# Tiff page processing application - rotate Tiff page


C# Tiff processing application - delete Tiff page


C# Tiff processing application - sort Tiff pages


C# Tiff processing application - extract Tiff pages




How to Insert a New Blank TIFF Page in C#



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;


In this section, we will guide you to add a new Tiff document page in C#.NET project in Visual Studio by using RasterEdge XDoc.Tiff for .NET SDK.


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.




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

            // Construct a Tiff page from a Jpeg image.
            Bitmap img = new Bitmap(@"F:\demo1.bmp");
            TIFFPage page = new TIFFPage(img);

            // Insert the page before page 3. Note, page number is starting from 0.
            doc.InsertPage(page, 2);
            doc.Save(@"F:\insert.tif");



public override void InsertPage(BasePage basePage, int pageIdx)

Description:
Insert a tiff page to TIFF file at specified position.

Parameters:
public override void InsertPages(BasePage[] Bapages, int pageOffset)

Description:
Insert tiff pages to TIFF file at specified position.

Parameters:
public override void AddPage(BasePage newPage)

Description:
Add a tiff page to TIFF file, the new page will be the last page of the file

Parameters:
public override void AddPages(BasePage[] pages)

Description:
Add tiff pages to TIFF file, the new pages will follow the last page of the file.

Parameters: