Using the Browser Rendering API to create a new page, go to the URL of a PDF, and then return a scre

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.

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
GakskEXXoAAe7Hi.png
Was this page helpful?