It seems that you want to create an HTML file that links to specific pages inside a PDF. This can be done using Open Parameters. For a full overview of Open Parameters, see Parameters for Opening PDF Files. This is a publication from Adobe. It explains which Open Parameters are accepted by Adobe Reader and Adobe Acrobat. These parameters probably won't work for every other PDF viewer found in the wild.
Basically, you can create a URL like this: http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/pdf_reference_1-7.pdf#page=5&view=Fit
If you use Adobe Reader for viewing that document, the document will open on page 5 and the page will fit the viewing window. I have tested this on Edge's and Chrome's PDF viewer, and it doesn't work. However, if I try this on pdf.js in Firefox, it works.
These are some of the parameters you can use:
- nameddest=name Jumps to a named destination with name name in the PDF.
- page=pagenum Jumps to the page with page number pagenum. This number indicates the actual page, not the label you may have given the page.
- zoom=scale[, left, top] Sets the zoom and scroll factors. A scale value of 100 gives 100 percent zoom; left and top are set in a coordinate system where the origin is the top left of the visible page, regardless of the document rotation.
- view=fit[,parameter] Sets the zoom factor based on the page size. The value for fit can be Fit, FitH, FitV, FitB, FitBH, or FitVH.
- viewrect=left,top,width,height Opens the file so that the rectangle specified with the parameters is visible.
I wouldn't invest any time in this requirement if you can't control the end user's browser. I would simply tell the person who gave you the assignment that he asked for something that is impossible.
However, if you can convince the end user to use a decent PDF viewer (preferably the Adobe Reader plug-in in browsers that accept it), you can use iText to extract bookmarks or named destinations from a PDF and use them to create a TOC in HTML. I remember that I made such an example once, but I can't locate it anymore. I think I removed it, because too many people complained that "it didn't work." It used to work back in the days that everyone was using the Adobe Reader plug-in, but nowadays, there are so many PDF viewers around and almost no one still uses Adobe Reader in a browser context.