Selenium Java aShot fullscreen screenshot of PDF not working

433 Views Asked by At

I'm trying to take a fullscreen screenshot of a PDF viewed in the browser using aShot, but it's only taking a screenshot of the top of the page. I've tried on Firefox and Chrome, and neither seem to be working. Works fine on any normal webpage I've tried. I'm assuming there's something about PDFs, or PDF viewers that it doesn't like?

I've tried against an actual file path to a pdf in my downloads folder, as well as an actual HTTPS web address like this: https://mozilla.github.io/pdf.js/web/viewer.html and neither worked

driver.get("https://mozilla.github.io/pdf.js/web/viewer.html");
Screenshot screenshot = new AShot().shootingStrategy(ShootingStrategies.viewportPasting(1000)).takeScreenshot(driver);
0

There are 0 best solutions below