Skip to main content
Skip table of contents

pdfRender: WEBP format support added

In our iText 7.1.14 release we've added support for the WEBP image format to pdfRender 1.0.3. This is a modern image format which employs both lossy and lossless compression, and typically produces smaller images than JPEG or PNG at equivalent quality settings.

JAVA

JAVA
import com.itextpdf.licensekey.LicenseKey;
import com.itextpdf.pdfrender.PdfRenderImageType;
import com.itextpdf.pdfrender.PdfToImageRenderer;
import com.itextpdf.pdfrender.RenderingProperties;
import java.io.File;
import java.io.IOException;

public class WEBP_Example {
    public static final String DEST = "results/result";
    public static final String SRC = "src/main/resources/simple.pdf";
    private static final String KEY = "src/main/resources/itextkey_pdfRender.xml";

    static {
        new File(DEST).getParentFile().mkdirs();
    }

    public static void main(String[] args) throws IOException {
        LicenseKey.loadLicenseFile(KEY);
        RenderingProperties properties = new RenderingProperties();
        properties.setImageType(PdfRenderImageType.WEBP);

        // Render PDF to images
        PdfToImageRenderer.renderPdf(new File(SRC), DEST, properties, null, null);
    }
}




We do not currently have a pdfRender .NET library available, however we do have a CLI (command line interface) version which will work with multiple programming languages (including C# for .NET).
For more information regarding the pdfRender CLI please refer to our FAQ.

JavaScript errors detected

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

If this problem persists, please contact our support.