Created
November 28, 2019 16:47
-
-
Save FabianoCampos/f9e28c42662f60a8bfe1b892c214438d to your computer and use it in GitHub Desktop.
Pegar a quantidade de páginas do arquivo com JavaScript
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
var input = document.getElementById("files"); | |
var reader = new FileReader(); | |
reader.readAsBinaryString(input.files[0]); | |
reader.onloadend = function(){ | |
var count = reader.result.match(/\/Type[\s]*\/Page[^s]/g).length; | |
console.log('Number of Pages:',count ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment