Last active
September 15, 2019 08:59
-
-
Save Odepax/e7016b9babf1fdf26e09e8895a78dac5 to your computer and use it in GitHub Desktop.
Page-basis PDF2PNG converter for Firefox.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Note: the PDF must be image-based. Makes it not generic, but very usefull in some situations. | |
// Put this in the console: | |
// EXE: (function (pageId) { ... })("page3"); | |
;(function(pageId = "page1") { | |
const canvas = document.getElementById(pageId) | |
const image = new Image() | |
image.src = canvas.toDataURL("image/png") | |
document.body.innerHTML = null | |
document.body.appendChild(image) | |
})(/* Indicate page id (as "page#") here */); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment