Sample code to convert PDF to HTML


I am trying to locate the sample code for PDF2HTML (preferably for c++). I see it mentioned in your literature, and there is even a URL that should bring me to the sample code, but PDF2HTML is not there.


For a quick test drive use docpub CLI (
docpub -f html my.pdf

In case of PDFNet SDK, the conversion should be as simple as:

PDFDoc pdfdoc;

Convert::ToHtml("my.pdf", "html");

There are also a number of relevant conversion options:

For a more complete sample (including PDF to HTML conversion), see Convert sample:
(C++ version)

It’s in the ConvertSpecificFormats() function, second from the bottom.
For alternative ways to visualize PDF in browser see

For more info about PDF to HTML/EPUB see

Q: Is there any way to limit the page range when converting from PDF to HTML


Currently you can use doc.PageRemove() on pages you don’t want to convert prior to conversion. Please note that this operation is very fast and you do not need to save (or serialize modified PDF) before converting to HTML.