fix page order when > 99 pages

This commit is contained in:
quenousimporte 2024-06-20 10:18:54 +02:00
parent eb34a4df54
commit 1cf5dd0fcc
1 changed files with 5 additions and 2 deletions

View File

@ -18,8 +18,11 @@ function getpage(page)
{
if (blob.size)
{
console.log("Downloading page " + page);
var pagename = page < 10 ? "0" + page : page;
var pagename = page;
if (page < 10) pagename = "00" + pagename;
else if (page < 100) pagename = "0" + pagename;
console.log("Downloading page " + pagename);
var filename = basename + "-" + pagename + ".pdf";
var a = document.createElement('a');
a.href = window.URL.createObjectURL(blob);