GdPicture.NET.14.API
GdPicture14 Namespace / GdPicturePDF Class / MergePages Method
An array of the integer values specifying page numbers that shall be merged.
Set this parameter to true if you want to remove specified pages after merging, otherwise set it to false.

First page in list will not be deleted even if this parameter is set to true.

Example





In This Topic
MergePages Method (GdPicturePDF)
In This Topic
Merges list of pages within the currently loaded PDF document.

Pages content will be appended to the first page in list in corresponding order and first page height will be incremented with each appended page.

Syntax
'Declaration
 
Public Function MergePages( _
   ByVal Pages As IEnumerable(Of Integer), _
   ByVal RemovePages As Boolean _
) As GdPictureStatus
public GdPictureStatus MergePages( 
   IEnumerable<int> Pages,
   bool RemovePages
)
public function MergePages( 
    Pages: IEnumerable;
    RemovePages: Boolean
): GdPictureStatus; 
public function MergePages( 
   Pages : IEnumerable,
   RemovePages : boolean
) : GdPictureStatus;
public: GdPictureStatus MergePages( 
   IEnumerable<int>* Pages,
   bool RemovePages
) 
public:
GdPictureStatus MergePages( 
   IEnumerable<int>^ Pages,
   bool RemovePages
) 

Parameters

Pages
An array of the integer values specifying page numbers that shall be merged.
RemovePages
Set this parameter to true if you want to remove specified pages after merging, otherwise set it to false.

First page in list will not be deleted even if this parameter is set to true.

Return Value

A member of the GdPictureStatus enumeration. If the method has been successfully followed, then the return value is GdPictureStatus.OK.

We strongly recommend always checking this status first.

Remarks
This method is only allowed for use with non-encrypted documents.

This method requires the Document Editor component to run.

Example
How to merge 2 PDF document pages into single page.
Using gdpicturePDF As New GdPicturePDF
    gdpicturePDF.LoadFromFile("input.pdf")
    Dim pages As New List(Of Integer)({ 1, 2 })
    gdpicturePDF.MergePages(pages, True)
    gdpicturePDF.SaveToFile("output.pdf")
End Using
using (GdPicturePDF gdpicturePDF = new GdPicturePDF())
{
    gdpicturePDF.LoadFromFile("input.pdf", false);
      List<int> pages = new List<int> { 1, 2 }; 
    gdpicturePDF.MergePages(pages, true);
    gdpicturePDF.SaveToFile("output.pdf");
}
See Also