Hi,
I would like to know if it is possible to open a PDF onto a canvas like an iframe view. Are there any examples?
Hi,
I would like to know if it is possible to open a PDF onto a canvas like an iframe view. Are there any examples?
Well, question is not really Babylon related, but this might help you.
For this purpose I would recommend to use pdf.js from Mozilla. You may use iframe or put ctx to Dynamic Texture inside 3D scene, it is up to you.
https://mozilla.github.io/pdf.js/
Thanks! Can you recommend any example to follow ? Because I am not sure how to integrate it in Babylon.
Take the simplest one as at https://jsfiddle.net/pdfjs/9engc9mw/
Get the content of PDF to canvas, then do with this canvas what you need to.
To use this canvas for Dynamic Texture see Dynamic Textures | Babylon.js Documentation
Would be nice to see your implementation
Hey I used as simple as an iframe with higher z-index. It works as expected I can add http links, images and also pdfs
<iframe
src="myPDF.pdf"
style="
position: fixed;
top: 0px;
bottom: 0px;
right: 0px;
width: 100%;
border: none;
margin: 0;
padding: 0;
overflow: hidden;
z-index: 999999;
height: 100%;
">
</iframe>