zeltox / Google-Drive-PDF-Downloader

MIT License
450 stars 126 forks source link

Improving Quality #12

Open rafi-d opened 3 years ago

rafi-d commented 3 years ago

Hi, I am using your convertor, successfully, but have noticed one issue: If I am using the default google size, - the quality is very poor. Once I "resize to fit" (middle control icon_ - the quality is much better (file is also larger). I have experimented with full zoom (the "+" control button - to the max zoom ) - and it produced even larger file with a little bit better quality.

Can you fix your first script , to adjust the size (possibly to "fit" ) before starting to process the pages?

And a quick question - is it possible not to visibly scroll the document during processing? I think it will achieve a faster speed.

Thanks for the useful tool!

Rafi

elosha commented 1 year ago

Possible solutions to force Google to deliver better image quality:

  1. Trigger the "Optimum size" button – wasn't able to do this, even though I grabbed the button by window.querySelector("div[aria-label^=Optim]")
  2. Set window.devicePixelRatio to a higher-than-real value like 6 to make Google deliver pictures for a very high-res screen – tested and works
  3. Modify or the HTTP requests that go to drive.google.com when the actual image files are requested, set the width parameter w=1600 – difficult and untested