Sample code to convert PDF to HTML

116 views
Skip to first unread message

Support

unread,
May 8, 2014, 2:56:10 PM5/8/14
to pdfne...@googlegroups.com
Q:

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.

---------
A:

For a quick test drive use docpub CLI (http://www.pdftron.com/docpub/downloads.html):
     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:

 http://www.pdftron.com/pdfnet/docs/PDFNetC/dc/dee/classpdftron_1_1_p_d_f_1_1_convert_1_1_h_t_m_l_output_options.html


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



It's in the ConvertSpecificFormats() function, second from the bottom.
For alternative ways to visualize PDF in browser see http://blog.pdftron.com/2013/08/08/how-to-integrate-a-pdf-viewer-in-html5-apps/


Support

unread,
May 8, 2014, 6:27:02 PM5/8/14
to pdfne...@googlegroups.com
Q:  Is there any way to limit the page range when converting from PDF to HTML

--------
A:

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.

Reply all
Reply to author
Forward
0 new messages