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 As IEnumerable(Of Integer), _
ByVal As Boolean _
) As GdPictureStatus
public GdPictureStatus MergePages(
IEnumerable<int> ,
bool
)
public function MergePages(
: IEnumerable;
: Boolean
): GdPictureStatus;
public function MergePages(
: IEnumerable,
: boolean
) : GdPictureStatus;
public: GdPictureStatus MergePages(
IEnumerable<int>* ,
bool
)
public:
GdPictureStatus MergePages(
IEnumerable<int>^ ,
bool
)
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.
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");
}
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 pages = new List { 1, 2 };
gdpicturePDF.MergePages(pages, true);
gdpicturePDF.SaveToFile("output.pdf");
}
See Also