C#: Online Guide
How To: Word SDK
Page: Insert Word Pages
Page: Insert Word Pages
  |  
Home ›› XDoc.Word ›› C# Word: Insert Word Pages

C# Word - Insert Blank Word Page in C#.NET


Guide C# Users to Insert (Empty) Word Page or Pages from a Supported File Format




Overview



C#.NET Word document editor library control, RasterEdge XDoc.Word, offers easy & mature APIs for developers to add & insert an (empty) page into an existing Word document file. Besides, this Word document page inserting library control toolkit allows developers to specify where they want to insert (blank) Word document page (before the first page or after the last page or after any desired page of current Word document) using C# .NET class code.


Related .net document control helps:
asp.net edit pdf image: ASP.NET PDF Image Edit Control: online insert, edit PDF images in C#
asp.net edit pdf text: ASP.NET PDF Text Edit Control: online edit PDF text content using C# ASP.NET
asp.net dnn pdf editor: ASP.NET DNN PDF Editor Control: view, edit PDF files in Dotnetnuke application
asp.net tiff document viewer: ASP.NET Tiff Document Viewer: view, annotate Tiff files in HTML using C# Control
asp.net azure pdf editor: ASP.NET Azure PDF Editor Control: view, edit, annotate, redact PDF files online
asp.net pdf file permission: ASP.NET PDF File Permission Control: apply, remove PDF file permission settings in C#
asp.net open pdf password: ASP.NET PDF Password Edit Control: online add, remove, update PDF file open password using C#


This C# .NET Word document page inserting & adding component from RasterEdge is written in managed C# code and designed particularly for .NET class applications. Thus, using this Word document page manipulating and processing control SDK, you can create & add new Word page(s) to current target Word document in both web server-side application and Windows Forms project using a few lines of simple C# code.


Apart from the ability to inserting a new Word page into existing Word document file, RasterEdge C# .NET Word document page processing and editing control toolkit also owns other advanced Word document page manipulating functions. RasterEdge offers detailed guidances for each of those page processing functions, such as how to merge Word document files by C# code, how to rotate Word document page, how to delete Word page using C# .NET, how to reorganize Word document pages and how to split Word document in C# .NET class application.


By using reliable APIs, C# programmers are capable of adding and inserting (empty) Word page or pages from various file formats, such as Word, Tiff, Word, Excel, PowerPoint, Bmp, Jpeg, Png, Gif, and so on. Some C# demos are provided for your reference.




C# DLLs: Insert Word Page



Add references:


  RasterEdge.Imaging.Basic.dll


  RasterEdge.XDoc.Office.Inner.Common.dll


  RasterEdge.Imaging.Drawing.dll


  RasterEdge.Imaging.Processing.dll


  RasterEdge.XDoc.Office.Inner.Office03.dll


  RasterEdge.Imaging.Font.dll


  RasterEdge.XDoc.Word.dll


  RasterEdge.XImage.Raster.Core.dll


  RasterEdge.XImage.Raster.dll


Use corresponding namespaces;


  using RasterEdge.Imaging.Basic;


  using RasterEdge.XDoc.Word;




Add and Insert a blank Page to Word File in C#



This C# demo will help you to insert a Word page to a DOCXDocument object at specified position.




String inputFilePath1 = Program.RootPath + "\\" + "1.docx";
String outPutFilePath = Program.RootPath + "\\" + "Output.docx";

DOCXDocument doc1 = new DOCXDocument(inputFilePath1);
// Specify a position for inserting the selected page.
int pageIndex = 2;

// Insert the page to the DOCXDocument at specified position.
doc1.AddEmptyPage( pageIndex);

// Output the new document.
doc1.Save(outPutFilePath);





Add and Insert Multiple Word Pages to Word Document Using C#



Moreover, you may use the following C# demo code to insert multiple pages of a Word file to a DOCXDocument object at user-defined position.




String inputFilePath1 = Program.RootPath + "\\" + "1.docx";
String outPutFilePath = Program.RootPath + "\\" + "Output.docx";

DOCXDocument doc1 = new DOCXDocument(inputFilePath1);
// Specify a position for inserting the selected pages.
int pageIndex = 1;

// Insert the pages to the second document at specified position.
doc2.InsertPages(pages, pageIndex);

// Output the new document.
doc2.Save(outPutFilePath);