Convert EPUB to APNG via Java

Export EPUB file to APNG within any within any Java J2SE, J2EE, J2ME applications without using Adobe® Acrobat Reader

 

You can convert epub file to APNG image in Java in two simple steps. Firstly, by using Aspose.PDF for Java , you can export EPUB to JPEG. After that, by using Aspose.Imaging for Java Image Processing API, you can render JPEG to APNG. Both APIs come under the Aspose.Total for Java package.

Export EPUB to APNG via Java

  1. Open EPUB file using Document class
  2. Initialize class object and render EPUB to JPEG by using Process method
  3. Load JPEG file by using Image class
  4. Save the document to APNG format using save method

Get Started with Java File Automation APIs

You can easily use Aspose.Total for Java directly from a Maven based project and include libraries in your pom.xml.

Alternatively, you can get a ZIP file from downloads .

Convert EPUB to APNG in a Single File via Java

The API also allows you to export EPUB file to APNG to a single file. In order to convert all pages, you can first render your EPUB document to one TIFF file and after that, you can export the TIFF file to APNG. You can open the input file using Document class and create Resolution, TiffSettings, & TIFF device objects. You can get a single TIFF image using process method of TiffDevice class. Finally, you can load TIFF file using Image class and save it to APNG format using save method.

Convert EPUB to APNG With Watermark via Java

Using the API, you can also export EPUB file to APNG with watermark in your APNG document. In order to add a watermark to you can first convert EPUB to JPEG and add a watermark in it. In order to add watermark, load an image file using the Image class, create an object of the Graphics class and initialize it with Image object, create a new Matrix object and set translation and transformation to the desired angle and add watermark using Graphics.drawString method. After adding the watermark in your image, you can save the JPEG as APNG format.

Convert & Rotate EPUB to APNG File via Java

Using the API, you can also rotate the output APNG image as per your needs. The Image.rotateFlip method can be used to rotate the image by 90/180/270-degrees and flip the image horizontally or vertically. The library provides simple methods to perform complex operations while encapsulating all ugly details. You can specify the type of rotation and flip to apply to the image. In order to rotate and flip the image, you can load the converted JPEG image using the Image class and call the Image.rotateFlip method while specifying the appropriate RotateFlipType .

Other Conversion Options

EPUB TO DXF (Autodesk Drawing Exchange Format)
EPUB TO PSD (Photoshop Document)
EPUB TO SVGZ (Compressed Scalable Vector Graphics)
EPUB TO EMZ (Windows Compressed Enhanced Metafile)
EPUB TO TGA (Truevision Graphics Adapter)
EPUB TO WMZ (Compressed Windows Metafile)
EPUB TO WMF (Windows Metafile)
EPUB TO IMAGE (Image Files)
EPUB TO DICOM (Digital Imaging and Communications in Medicine)

EPUB What is EPUB File Format?

Files with .epub extension are an e-book file format that provide a standard digital publication format for publishers and consumers. The format has been so common by now that it is supported by many e-readers and software applications. For example, on Mac OS, the pre-installed Books software provides the support for opening such files. In addition, there are a lot of compatible software available for smartphones, tablets and computers. EPUB file standards are maintained by the International Digital Publishing Forum (IDPF). The version EPUB 3 is also endorsed by the Book Industry Study Group (BISG), a leading book trade association for standardized best practices, research, information and events, for packaging of content.

Read More

APNG What is APNG File Format?

A file with .apng (Animated Portable Network Graphics) extension is a raster graphic format and is an unofficial extension to the Portable Network Graphic (PNG ). It comprises of multiple frames (each of PNG image) that represents an animation sequence. This gives similar visualization as a GIF file. APNG files support 24-bit images and 8-bit transparency. APNG is backward compatible with non-animated GIF files. APNG files use the same .png extension and can be opened by applications such as Mozilla Firefox, Chrome with APNG support, iMessage apps for iOS 10.

Read More