Closed Manasseh-Ankrah closed 2 years ago
Hi, a bit more information would be helpful.....
//index.js
const { pdf } = require("pdf-to-img");
it("generates a PDF", async () => { for await (const page of await pdf("https://v.nicmid.com/STSAC20961459074225052.pdf")) { expect(page).toMatchImageSnapshot(); } });
//Error Message
PS C:\Users\Manasseh Ankrah\Documents\Projects\i-sticker\backend> node pdf-img C:\Users\Manasseh Ankrah\Documents\Projects\i-sticker\backend\pdf-img.js:3 it("generates a PDF", async () => { ^
ReferenceError: it is not defined
at Object.
you're using a code snippet for a testing framework such as jest
or mocha
.
If you want to use this module without a test framework, just use something like this:
for await (const page of await pdf("./path/to/my/file.pdf")) {
expect(page).toMatchImageSnapshot();
}
Thanks for your reply I really appreciate it.
Please, does this library support pdf from urls ? example: https://v.nicmid.com/STSAC20961459074225052.pdf
No, you must download the file using a different module
Alright, Thank You
Please I need help on how to solve this issue. Thank you!