You can find more details at: Convert EPUB to a PNG or JPG Image in Java
Last active
May 11, 2022 22:29
-
-
Save aspose-com-gists/2fff978f63b6bdf4720f62cc37ee3eb4 to your computer and use it in GitHub Desktop.
Convert EPUB to JPG or PNG Image in Java
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
// Prepare a path to a source EPUB file | |
String sourcePath = "input.epub"; | |
// Prepare a path to save the converted file | |
String outputPath = "output.jpg"; | |
// Create an instance of ImageSaveOptions | |
ImageSaveOptions options = new ImageSaveOptions(); | |
options.setFormat(ImageFormat.Jpeg); | |
options.setSmoothingMode(SmoothingMode.HighQuality); | |
options.getPageSetup().setAnyPage(new Page( | |
new Size( | |
Length.fromInches(4), | |
Length.fromInches(5.5)))); | |
// Call the ConvertEPUB method to convert EPUB to JPG Image | |
Converter.convertEPUB(sourcePath, options, outputPath); |
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
// Prepare a path to a source EPUB file | |
String sourcePath = "input.epub"; | |
// Prepare a path to save the converted file | |
String outputPath = "output.png"; | |
// Create an instance of ImageSaveOptions | |
ImageSaveOptions options = new ImageSaveOptions(); | |
options.setFormat(ImageFormat.Png); | |
options.getPageSetup().getAnyPage().setSize(new Size(500, 500)); | |
// Call the ConvertEPUB method to convert EPUB to PNG Image | |
Converter.convertEPUB(sourcePath, options, outputPath); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment