Dear PDFBox developers, I'm writing to request an enhancement to the JPEGFactory class, specifically concerning the createFromImage(PDDocument document, BufferedImage image, float quality, int dpi) method.
Currently, when using this method, there isn't a direct way to enable the setOptimizeHuffmanTables option of JPEGImageWriteParam. This optimization can be quite beneficial for reducing file size. To work around this, my team currently has to copy the JPEGFactory source code into our project and modify the private encodeImageToJPEGStream method. This approach isn't ideal as it makes maintenance more difficult and prevents us from easily updating to new PDFBox versions. Would you consider exposing this setOptimizeHuffmanTables option, perhaps as an additional parameter to the createFromImage method or through a separate setter on JPEGFactory? This would allow users to leverage this optimization without resorting to workarounds. Thank you for considering this request. Thanks and regards, Zer Jun Eng