Skip to content

Commit 9e093e8

Browse files
author
Andrey
committed
Simplified page retrieval.
1 parent 36828e4 commit 9e093e8

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,7 @@ app.get('/thumbnail/:filename', (req, res) => {
6868
const doc = await PDFNet.PDFDoc.createFromFilePath(pathname+filename);
6969
await doc.initSecurityHandler();
7070
const pdfdraw = await PDFNet.PDFDraw.create(92);
71-
const itr = await doc.getPageIterator(1);
72-
const currPage = await itr.current();
71+
const currPage = await doc.getPage(1);
7372
await pdfdraw.export(currPage, `${pathname}${filename}.png`, 'PNG');
7473
};
7574

0 commit comments

Comments
 (0)