2

I want to save my pdf as image, this is the screen shot of my web page and due to the script, the entire page displays as pdf when i use ctrl+p, now I want this entire pdf as a image how can I do this. I want the image to displayed when i click the "confirm order" button.

<button>Confirm order</button>

This is the script i am using for the webpage to be displayed as pdf

<script type="text/javascript" src="js/THREEx.screenshot.js"></script>

<script>
    var dataUrl = renderer.domElement.toDataURL("image/png");
    var renderer = new THREE.WebGLRenderer({
        preserveDrawingBuffer: true   // required to support .toDataURL()
    });

    THREEx.Screenshot.bindKey(renderer);
</script>
uladzimir
  • 5,639
  • 6
  • 31
  • 50
sandy
  • 31
  • 1
  • 4
  • possible duplicate of [PDF to image using Java](http://stackoverflow.com/questions/4886042/pdf-to-image-using-java) – Neeraj Jain Jul 06 '15 at 12:07
  • possible duplicate of [Export PDF pages to a series of images in Java](http://stackoverflow.com/questions/550129/export-pdf-pages-to-a-series-of-images-in-java) – Sagar Naliyapara Jul 06 '15 at 12:08
  • 2
    All this time I thought that javascript wasn't java –  Jul 06 '15 at 12:26
  • why are you guys so bothered about javascript is not the same as java. clearly Neeraj Jain was proposing using the backend to prepare the image version of the pdf – Ji_in_coding Jul 06 '15 at 13:04
  • 2
    Did you look at libraries such as PDF.js which lets you render image into a canvas. http://stackoverflow.com/questions/12921052/parsing-pdf-pages-as-javascript-images & http://stackoverflow.com/questions/9328551/how-to-use-pdf-js – fsacer Jul 06 '15 at 13:22
  • See http://stackoverflow.com/questions/12921052/parsing-pdf-pages-as-javascript-images – userDEV Jul 06 '15 at 13:56

0 Answers0