optional PDF screenshot algorithm