Converting PDF to HTML generates images with jpg format but saves it as png

Hi Support Team,

I am trying to generate HTML from a PDF File. The generated html looks good except for images which are embedded in SVG. It generated the embedded images as png and they are also saved as PNG in the file system but if you check the image header it is actually a JPG file and should be saved as JPG.

Could you please check why it is saving an image file with JPG header as PNG.

// Instantiate HTML Save options object
Document doc = new Document(stream);
HtmlSaveOptions saveOptions = new HtmlSaveOptions();
saveOptions.setFixedLayout(true);
saveOptions.setPartsEmbeddingMode(HtmlSaveOptions.PartsEmbeddingModes.NoEmbedding);
saveOptions.setRasterImagesSavingMode(HtmlSaveOptions.RasterImagesSavingModes.AsExternalPngFilesReferencedViaSvg);
  // Save the output file
doc.save(filePath, saveOptions);

sample.pdf (122.2 KB)

@pariyani

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): PDFJAVA-44524

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.