Last active
May 7, 2021 02:54
-
-
Save aspose-com-gists/a38f7642215d4281c357d6e1287dc816 to your computer and use it in GitHub Desktop.
Convert PDF to HTML using C++
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Examples for converting PDF to HTML using C++. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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