Skip to main content
Skip table of contents

pdfRender: HEIC image encoding support

Version 2.0.2 of the pdfRender iText 7 add-on now supports the encoding of HEIC images. HEIC is the common name for HEIF (High-Efficiency Image Format) images using the default HEVC encoding format. It has been the default image format for Apple's desktop and mobile operating systems since 2017, being introduced in macOS High Sierra and iOS 11.

HEIC images typically take up around half the space of an equivalent quality JPEG and it is a more efficient and flexible format than PNG. This has led Apple to champion the format as a general replacement for JPEG.

The addition of HEIC support in pdfRender introduces a new Enum value for our PdfRenderImageType class. The following example shows how to specify HEIC as the output format:

Java

JAVA
    public static void main(String[] args) throws IOException {
        final RenderingProperties properties = new RenderingProperties();
        properties.setImageType(PdfRenderImageType.HEIC);
        PdfToImageRenderer.renderPdf(new File(INPUTPDF), new File(OUTPUTIMAGE), properties);
        System.out.println("pdfRender has completed!");
    }

If you use pdfRender CLI, simply do the following:

CLI

TEXT
pdfrender --license <path to license file> --pdf rendertest.pdf --out-path-pattern rendertest --scaling 0.5 --type heic
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.