Save images,fonts into a seperate folder while converting pdf to html

Hi,
I am trying to convert pdf to html,but during that conversion, I want fonts,images to be saved in a separate folder without being embedded into the html file itself

@pooja.jayan

Below simple code will generate separate folder for images and fonts:

Aspose.Pdf.Document pdfDocument = new Aspose.Pdf.Document(dataDir + "Aspose_input.pdf");
// Instantiate HTML Save options object
HtmlSaveOptions newOptions = new HtmlSaveOptions();
pdfDocument.Save(dataDir + "output.html", newOptions);

Is it possible to save only images in a separate folder and rest of the resources embedded in the html file itself

@pooja.jayan

Can you please share sample PDF for our reference so that we can test the scenario in our environment and address it accordingly.

download.pdf (540.7 KB)

@pooja.jayan

We are checking it and will get back to you shortly.

@pooja.jayan

To save only images in a separate folder and rest of the resources embedded in the HTML file itself, you can use the EmbedImagesOnly value. For example:

// Load the PDF file
Document pdfDocument = new Document("input.pdf");

// Create an instance of HtmlSaveOptions
HtmlSaveOptions htmlOptions = new HtmlSaveOptions();

// Specify to embed only images into the HTML file
htmlOptions.PartsEmbeddingMode = HtmlSaveOptions.PartsEmbeddingModes.EmbedImagesOnly;

// Save the document
pdfDocument.Save("output.html", htmlOptions); 

This will save the images in a folder named “output_images” and embed the fonts and CSS into the HTML file.