Browser Rendering API Puppeteer not rendering a PDF

Using the Browser Rendering API to create a new page, go to the URL of a PDF, and then return a screenshot doesn't seem to be able to load the PDF itself, any suggestions or is this simply not one of those use cases the Browser Rendering API should be used for? 😅 Slimmed down version of my Worker code:
const browser = await puppeteer.launch(env.BROWSER);
const page = await browser.newPage();

await page.goto(url, {
waitUntil: 'networkidle0',
});

const img = (await page.screenshot()) as Buffer;

// Here I upload to R2/handle, return a response, etc.
const browser = await puppeteer.launch(env.BROWSER);
const page = await browser.newPage();

await page.goto(url, {
waitUntil: 'networkidle0',
});

const img = (await page.screenshot()) as Buffer;

// Here I upload to R2/handle, return a response, etc.
If it's not the blank screenshot attached, it's a timeout due to exceeding the 30s navigation timeout. An example PDF I found on GitHub if anyone wants to try it: usbtemp.s3.amazonaws.com/terms.pdf
No description
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server