Skip to content

Instantly share code, notes, and snippets.

@aspose-com-gists
Last active May 7, 2021 02:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aspose-com-gists/a38f7642215d4281c357d6e1287dc816 to your computer and use it in GitHub Desktop.
Save aspose-com-gists/a38f7642215d4281c357d6e1287dc816 to your computer and use it in GitHub Desktop.
Convert PDF to HTML using C++
Examples for converting PDF to HTML using C++.
// Open the source PDF document
auto pdfDocument = MakeObject<Document>(u"SourceDirectory\\Sample 1.pdf");
// Create an instance of the HtmlSaveOptions class
SharedPtr<HtmlSaveOptions> options = MakeObject<HtmlSaveOptions>();
// Set the desired options
options->PartsEmbeddingMode = HtmlSaveOptions::PartsEmbeddingModes::EmbedAllIntoHtml;
options->LettersPositioningMethod = HtmlSaveOptions::LettersPositioningMethods::UseEmUnitsAndCompensationOfRoundingErrorsInCss;
options->RasterImagesSavingMode = HtmlSaveOptions::RasterImagesSavingModes::AsEmbeddedPartsOfPngPageBackground;
options->FontSavingMode = HtmlSaveOptions::FontSavingModes::SaveInAllFormats;
// Save the HTML file
pdfDocument->Save(u"OutputDirectory\\output.html", options);
// Open the source PDF document
auto pdfDocument = MakeObject<Document>(u"SourceDirectory\\Sample 1.pdf");
// Save the HTML file
pdfDocument->Save(u"OutputDirectory\\output.html", SaveFormat::Html);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment