Would like display the pdf in the 3d space

Would like display the pdf in the 3d space, how to do it , can you refer me to some exmaples

var scene = new BABYLON.Scene(engine);
var camera = new BABYLON.FreeCamera(“camera1”, new BABYLON.Vector3(0, 5, -10), scene);
// This targets the camera to scene origin
camera.setTarget(BABYLON.Vector3.Zero());
// This attaches the camera to the canvas
camera.attachControl(canvas, true);

@Krishna_Kishore

Hello,
you can simply use pdf.js Examples
then you can use dynamic texture to convert the rendered pdf into usable canvas context or simply use canvas.todataurl.

Here’s an example I made for you
https://www.babylonjs-playground.com/#32HPCB#1

you can learn about other available api
https://mozilla.github.io/pdf.js/api/

4 Likes

@waverider404 can you please let me know how to render the pdf with orignal colors, in example document is have some grey sade

This is much better, i used backgroundmaterial
https://www.babylonjs-playground.com/#32HPCB#3

1 Like