Skip to content

Instantly share code, notes, and snippets.

Avatar

Aspose.com Gists aspose-com-gists

View GitHub Profile
@aspose-com-gists
aspose-com-gists / merge-onenote-pdf.java
Last active Aug 15, 2022
Merge or Combine OneNote Files in Java
View merge-onenote-pdf.java
// Load the OneNote .one file using Document class
com.aspose.note.Document oneSource = new com.aspose.note.Document(dataDir + "Sample1.one");
// Load the destination OneNote file
com.aspose.note.Document oneDestination = new com.aspose.note.Document(dataDir + "Quick Notes.one");
// Clone each page of the input file
for (com.aspose.note.Page page: oneSource)
{
oneDestination.appendChildLast(page.deepClone());
View color-conversion-using-default-profiles.cs
using Aspose.Imaging;
using Aspose.Imaging.Brushes;
using Aspose.Imaging.FileFormats.Jpeg;
using Aspose.Imaging.FileFormats.Png;
using Aspose.Imaging.ImageOptions;
using Aspose.Imaging.Sources;
using System.IO;
string templatesFolder = @"c:\Users\USER\Downloads\templates\";
string dataDir = templatesFolder;
View add-diagonal-watermark-to-image.cs
using Aspose.Imaging;
using Aspose.Imaging.Brushes;
using Aspose.Imaging.FileFormats.Jpeg;
using System.IO;
string templatesFolder = @"c:\Users\USER\Downloads\templates\";
string dataDir = templatesFolder;
// Load an existing JPG image
using (Image image = Image.Load(dataDir + "template.tiff"))
View protected-word-to-json.py
# Load protected document using LoadOptions
doc = aw.Document("protected_doc.docx", aw.loading.LoadOptions("MyPassword"))
# Save document in HTML format
doc.save("html_output.html", aw.SaveFormat.HTML)
# Load the HTML file in an instance of Workbook class
book = Workbook("html_output.html")
# Save as JSON
@aspose-com-gists
aspose-com-gists / doc-to-json.cs
Last active Aug 11, 2022
Convert Word to JSON in C# .NET
View doc-to-json.cs
// Load DOC document
Document doc = new Document("document.doc");
// Save document in HTML format
doc.Save("html_output.html", Aspose.Words.SaveFormat.Html);
// Load the HTML file in an instance of Aspose.Cells.Workbook class
Workbook book = new Workbook("html_output.html");
// Save as JSON
View Adding text_mtext.cs
// adding of Text
CadText text = new CadText();
text.DefaultValue = "Watermark text";
text.TextHeight = 40;
text.FirstAlignment = new Cad3DPoint(300, 40);
text.LayerName = "0";
cadImage.BlockEntities["*Model_Space"].AddEntity(text);
cadImage.UpdateSize();
// adding of Mtext
@aspose-com-gists
aspose-com-gists / Convert-EPS-to-PNG-Java.md
Last active Aug 5, 2022
Convert EPS to PNG in Java | PostScript EPS to PNG in Java
@aspose-com-gists
aspose-com-gists / OneNote-to-Excel-Java.java
Last active Aug 15, 2022
Convert OneNote to Excel XLS XLSX in Java
View OneNote-to-Excel-Java.java
// Initialize an instance of ByteArrayOutputStream class.
final ByteArrayOutputStream stream = new ByteArrayOutputStream();
// Load the OneNote .one file using Document class.
com.aspose.note.Document oneFile = new com.aspose.note.Document("Aspose.one");
// Export the .one file as PDF
oneFile.save(stream, com.aspose.note.SaveFormat.Pdf);
// Load the file using Aspose.PDF Document class.
@aspose-com-gists
aspose-com-gists / OneNote-to-Excel-csharp.cs
Last active Aug 15, 2022
Convert OneNote to Excel XLS XLSX in C#
View OneNote-to-Excel-csharp.cs
// Load the OneNote .one file using Document class.
Aspose.Note.Document oneFile = new Aspose.Note.Document("Aspose.one");
// Export the .one file as PDF
oneFile.Save(memoryStream, Aspose.Note.SaveFormat.Pdf);
// Load the file using Aspose.PDF Document class.
Aspose.Pdf.Document file = new Aspose.Pdf.Document(memoryStream);
// Convert the OneNote .one file as Excel worksheet.