Import Pdf to OneNote

Time to time is useful to import a piece of content from documents in other formats. One of the most popular formats is PDF. PDF is widely used as a standard format of exchanging documents between organizations, government sectors and in private.

If you need a good PDF converter in OneNote then pay attention to our product. With our application, you can easily convert PDF to OneNote and vice versa.

Aspose.Note for .NET supports importing from PDF without using any other component and provides a set of useful settings to accomplish this task. Using latest version of Aspose.Note you can:

  1. Specify any range of pages in Pdf document to import.
  2. Control how imported pages are merged to OneNote document.

It comes with the software library to help you convert and manage your PDF files into OneNote.

How to convert Pdf to OneNote

The Import method exposed by the Aspose.Note API lets you import data from the document in Pdf format:

Import all data from a set of Pdf files

You can import any data. It can be a text, an image, a table. The sample below shows how to import all pages from a set of PDF files page by page.

1var d = new Document();
2
3d.Import(Path.Combine(dataDir, "sampleText.pdf"))
4 .Import(Path.Combine(dataDir, "sampleImage.pdf"))
5 .Import(Path.Combine(dataDir, "sampleTable.pdf"));
6
7d.Save(Path.Combine(dataDir, "sample_SimpleMerge.one"));

Import every Pdf as single OneNote page

Time to time it is useful to just import all data from Pdf file as a single page. It can be any small document of few pages size like report/invoice/etc.

The sample below shows how to import all data from a set of PDF documents while merging pages from every PDF document to a single OneNote page.

 1var d = new Document();
 2
 3var importOptions = new PdfImportOptions();
 4var mergeOptions = new MergeOptions() { ImportAsSinglePage = true, PageSpacing = 100 };
 5
 6d.Import(Path.Combine(dataDir, "sampleText.pdf"), importOptions, mergeOptions)
 7 .Import(Path.Combine(dataDir, "sampleImage.pdf"), importOptions, mergeOptions)
 8 .Import(Path.Combine(dataDir, "sampleTable.pdf"), importOptions, mergeOptions);
 9
10d.Save(Path.Combine(dataDir, "sample_SinglePageMerge.one"));

Import all pages from Pdf and merge them using custom logic

Sometimes it is necessary to merge Pdf files according to a certain rule or logic. In this case a simple merging will not help us and in order to achieve our goal it is necessary to write custom logic for selecting pages and merging them to OneNote document.

The sample below shows how to import all pages from PDF grouping every 5 pages to a single OneNote page.

 1var d = new Document();
 2
 3var mergeOptions = new MergeOptions() { ImportAsSinglePage = true, PageSpacing = 100 };
 4
 5IEnumerable<Page> pages = PdfImporter.Import(Path.Combine(dataDir, "SampleGrouping.pdf"));
 6while (pages.Any())
 7{
 8    d.Merge(pages.Take(5), mergeOptions);
 9    pages = pages.Skip(5);
10}
11
12d.Save(Path.Combine(dataDir, "sample_CustomMerge.one"));
Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.