Class PdfImporter

PdfImporter class

The class providing api to import content from documents in PDF format. The api allows to import from PDF document located either in a file or in a stream using specified options. The import options are passed using PdfImportOptions.

public static class PdfImporter

Methods

NameDescription
static Import(Stream, PdfImportOptions)Imports content of PDF document from a provided stream.
static Import(string, PdfImportOptions)Imports content of PDF document from a specified file.

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