I don't know. But I feel that playing with pdf is tricky
I am not sure what the final product should look like or what its intent is, but playing with images of a pdf (if good enough for the intent) would be a lot more reproducible across different browsers/versions...
Outputting an html file rather than a pdf, if suitable with the whole project goal, would of course be the ideal solution...
It would be useful to know more about the app to come up with ideas a bit less ridiculous than mine (which are probably totally inadequate with the app). But I don't have a lot of hopes about showing pdf consistently across browsers. The "big ones" (Chromium, Firefox, etc.) will display them differently and the "more obscure ones" are likely not to display them at all...