This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Read Dublin Core metadata using Java | |
try (Metadata metadata = new Metadata("path/ebook.epub")) { | |
EpubRootPackage root = metadata.getRootPackageGeneric(); | |
System.out.println(root.getDublinCorePackage().getRights()); | |
System.out.println(root.getDublinCorePackage().getPublisher()); | |
System.out.println(root.getDublinCorePackage().getTitle()); | |
System.out.println(root.getDublinCorePackage().getCreator()); | |
System.out.println(root.getDublinCorePackage().getLanguage()); | |
System.out.println(root.getDublinCorePackage().getDate()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Read Dublin Core metadata using C# | |
using (Metadata metadata = new Metadata("path/ebook.epub")) | |
{ | |
var root = metadata.GetRootPackage<EpubRootPackage>(); | |
Console.WriteLine(root.DublinCorePackage.Rights); | |
Console.WriteLine(root.DublinCorePackage.Publisher); | |
Console.WriteLine(root.DublinCorePackage.Title); | |
Console.WriteLine(root.DublinCorePackage.Creator); | |
Console.WriteLine(root.DublinCorePackage.Language); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Edit PPT/PPTX presenatations in Java using GroupDocs presentation editing and automation API | |
// Load Presentation | |
PresentationLoadOptions loadOptions = new PresentationLoadOptions(); | |
loadOptions.setPassword("P@$$w0Rd"); | |
// Edit Presentation | |
Editor editor = new Editor(new FileInputStream("path/presentation.pptx"), loadOptions); | |
PresentationEditOptions editOptions = new PresentationEditOptions(); | |
editOptions.setSlideNumber(0); //1st slide |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Edit PPT/PPTX presenatations in C# using GroupDocs presentation editing and automation API | |
using (FileStream fs = File.OpenRead("path/presentation.pptx")) | |
{ | |
// Load Presentation | |
Options.PresentationLoadOptions loadOptions = new PresentationLoadOptions(); | |
loadOptions.Password = "P@$$w0Rd"; | |
// Edit Presentation | |
using (Editor editor = new Editor(delegate { return fs; }, delegate { return loadOptions; })) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Apply Image Watermark to specific page(s) of Word file using Java | |
Watermarker watermarker = new Watermarker("path/document.docx"); | |
ImageWatermark watermark = new ImageWatermark("path/watermark-logo.png"); | |
watermark.setOpacity(0.7); | |
watermark.setHorizontalAlignment(HorizontalAlignment.Center); | |
watermark.setVerticalAlignment(VerticalAlignment.Center); | |
// Add watermark to the last page | |
WordProcessingContent content = watermarker.getContent(WordProcessingContent.class); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add Watermark Image to specific page(s) of Word document using C# | |
using (Watermarker watermarker = new Watermarker("path/multipage-document.docx")) | |
{ | |
ImageWatermark watermark = new ImageWatermark("path/image.png") | |
{ | |
Opacity = .5, | |
HorizontalAlignment = HorizontalAlignment.Center, | |
VerticalAlignment = VerticalAlignment.Center | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Update password of the protected spreadsheet files using Java | |
*/ | |
LoadOptions loadOptions = new LoadOptions("mySECRETpassWORD"); | |
UpdatePasswordOptions updateOptions = new UpdatePasswordOptions("TOPSECRET_pa22WORD"); | |
Merger merger = new Merger("path/protected-spreadsheet.xlsx", loadOptions); | |
merger.updatePassword(updateOptions); | |
merger.save("path/pwd-changed-spreadsheet.xlsx"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Change password of protected Excel spreadsheets using C# | |
*/ | |
string filePath = @"path/protected-spreadsheet.xlsx"; | |
LoadOptions loadOptions = new LoadOptions("mySECRETpassWORD"); | |
UpdatePasswordOptions updateOptions = new UpdatePasswordOptions("TOPSECRET_pa22WORD"); | |
using (Merger merger = new Merger(filePath, loadOptions)) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Merge Selective Pages of Word Documents using Java | |
Merger merger = new Merger("source_document.docx")) | |
{ | |
// Set the merging options | |
JoinOptions joinOptions = new JoinOptions(2,3); // Specify the starting and ending page number | |
// Merge the documents | |
merger.join("document_to_merge.docx", joinOptions); // using joining settings | |
merger.join("another_document_to_merge.docx", new JoinOptions(new int[] { 2, 4, 6 })); // Specifying page number(s) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Merge Selective Pages of Word Documents using C# | |
using (Merger merger = new Merger("source_document.docx")) | |
{ | |
// Set the merging options | |
JoinOptions joinOptions = new JoinOptions(2,3); // Specify the starting and ending page number | |
// Merge the documents | |
merger.Join("document_to_merge.docx", joinOptions); // using joining settings | |
merger.Join("another_document_to_merge.docx", new JoinOptions(new[] { 2, 4, 6 })); // Specifying page number(s) | |