I'm working on a PDF Inspector, I found the HTML output in PDF.js very suitable for my case
so I'm wondering where can I find the conversion section from PDF to HTML?
PDF.js doesn't generate HTML, but draws the contents on a canvas element. This is done in https://github.com/mozilla/pdf.js/blob/master/src/display/canvas.js. There is also a back-end that draws the contents as SVG instead, which is available at https://github.com/mozilla/pdf.js/blob/master/src/display/svg.js.
Most helpful comment
PDF.js doesn't generate HTML, but draws the contents on a canvas element. This is done in https://github.com/mozilla/pdf.js/blob/master/src/display/canvas.js. There is also a back-end that draws the contents as SVG instead, which is available at https://github.com/mozilla/pdf.js/blob/master/src/display/svg.js.