Skip to content

Instantly share code, notes, and snippets.

@GroupDocsGists
Last active January 20, 2023 10:00
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 GroupDocsGists/2f133d40ed82eeafaa4896a21dddf251 to your computer and use it in GitHub Desktop.
Save GroupDocsGists/2f133d40ed82eeafaa4896a21dddf251 to your computer and use it in GitHub Desktop.
How to Convert PDF to HTML using C#
using GroupDocs.Conversion.Options.Convert;
...
// Convert PDF to HTML using C#
using (var converter = new GroupDocs.Conversion.Converter("path/document.pdf"))
{
var options = new WebConvertOptions();
converter.Convert("path/converted-pdf-to.html", options);
}
// Convert selected pages of password protected PDF to HTML using C#
using GroupDocs.Conversion.Options.Convert;
using GroupDocs.Conversion.Options.Load;
...
Func<LoadOptions> getLoadOptions = () => new PdfLoadOptions
{
Password = "file-password_123"
};
using (Converter converter = new Converter("path/protected-document.pdf", getLoadOptions))
{
// Prepare conversion options
WebConvertOptions options = new WebConvertOptions
{
PageNumber = 2,
FixedLayout = true,
PagesCount = 1,
FixedLayoutShowBorders = false
};
converter.Convert("path/converted-adv-pdf-to-.html", options);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment