Document.Merge

Document.Merge method

Merges a set of pages to the document.

public Document Merge(IEnumerable<Page> pages, MergeOptions mergeOptions = null)
ParameterTypeDescription
pagesIEnumerable`1A set of pages.
mergeOptionsMergeOptionsSpecifies the options how to merge provided pages.

Return Value

Returns the reference to the document.

Examples

Shows how to import all pages from PDF document grouping every 5 pages to a single OneNote page.

string dataDir = RunExamples.GetDataDir_Import();

var d = new Document();

var mergeOptions = new MergeOptions() { ImportAsSinglePage = true, PageSpacing = 100 };

IEnumerable<Page> pages = PdfImporter.Import(Path.Combine(dataDir, "SampleGrouping.pdf"));
while (pages.Any())
{
    d.Merge(pages.Take(5), mergeOptions);
    pages = pages.Skip(5);
}

d.Save(Path.Combine(dataDir, "sample_CustomMerge.one"));

See Also