article

How to Convert OneNote File or Specific Page of OneNote Document into PDF using .NET

Email
Submitted on: 2/17/2016 9:20:29 AM
By: Sherazam  
Level: Intermediate
User Rating: Unrated
Compatibility: C#, VB.NET
Views: 1656
 
     This Technical tip explains how .NET developers can convert OneNote document or specific page of OneNote document into image inside their .NET applications. Aspose.Note supports converting OneNote file to images. To use this feature, import the Aspose.Note.Saving namespace into your application project. It has numerous valuable classes for rendering, for example ImageSaveOptions, PdfSaveOptions, and SaveOptions. Aspose.Note for .NET offers the Document class that represents a OneNote file. The Document class exposes the Save method that can be called to convert the OneNote file into an image format. The ImageSaveOptions class provides options for creating PNG, GIF, JPEG or BMP files, such as PageIndex, SaveFormat and others.

 
				This Technical tip explains how .NET developers can convert OneNote document or specific page of OneNote document into image inside their .NET applications. Aspose.Note supports converting OneNote file to images. To use this feature, import the Aspose.Note.Saving namespace into your application project. It has numerous valuable classes for rendering, for example ImageSaveOptions, PdfSaveOptions, and SaveOptions. Aspose.Note for .NET offers the Document class that represents a OneNote file. The Document class exposes the Save method that can be called to convert the OneNote file into an image format. The ImageSaveOptions class provides options for creating PNG, GIF, JPEG or BMP files, such as PageIndex, SaveFormat and others. This article shows how to:
•	Save OneNote as image with the default settings.
•	Save a particular page of OneNote as image.
//Converting OneNote to Image using the Default Options
// [C# Code Sample]
// Load the document into Aspose.Note.
Document oneFile = new Document(@"FullFileName.one");
// Save the document as Gif.
oneFile.Save("FullFileName.gif", SaveFormat.Gif);
//[VB.NET Code Sample]
' Load the document into Aspose.Note.
Dim oneFile As New Document("FullFileName.one")
' Save the document as Gif.
oneFile.Save("FullFileName.gif", SaveFormat.Gif)
//Converting a Specific Page in a OneNote Document to Image
// [C# Code Sample]
// Load the document into Aspose.Note.
Document oneFile = new Document(@"FullFileName.one");
// Initialize ImageSaveOptions object
ImageSaveOptions opts = new ImageSaveOptions(SaveFormat.Png);
// set page index
opts.PageIndex = 1;
// Save the document as PNG.
oneFile.Save(@"FullFileName.png", opts);
//[VB.NET Code Sample]
' Load the document into Aspose.Note.
Dim oneFile As New Document("FullFileName.one")
' Initialize ImageSaveOptions object
Dim opts As New ImageSaveOptions(SaveFormat.Png)
' set page index
opts.PageIndex = 1
' Save the document as PNG.
oneFile.Save("FullFileName.png", opts)
Overview: Aspose.Note for .NET
Aspose.Note for .NET is a set of .NET components that enables developers to work with Microsoft Office OneNote files in C#, VB.NET, ASP.NET web applications, web services & Windows applications. It allows developers to open files & manipulate elements of OneNote books, from text, images & properties, to more complex elements, & then export to PNG, GIF, JPEG, BMP or PDF formats. It is a pure .NET alternative to the MS OneNote Object Model & supports OneNote 2010, OneNote® 2010 SP1 & 2013 files.


Other 44 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this article (in the Intermediate category)?
(The article with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments


 There are no comments on this submission.
 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular article, please click here instead.)
 

To post feedback, first please login.