mixu / electroshot

Capture website screenshots with optional device and network emulation as jpg, png or pdf (with web fonts!) using Electron / Chrome.
548 stars 34 forks source link

pdf format ignores selector option #23

Open arifb opened 6 years ago

arifb commented 6 years ago

Hi, thanks for the great project. When I select the pdf format, it seems the selector option (and maybe more, but not 100%) is ignored. electroshot http://localhost:3000/posters/1/preview 1920 --format jpg --selector "#viewer-container" result: localhost-posters-1-preview-1920x0

But with the pdf format option: electroshot http://localhost:3000/posters/1/preview 1920 --format pdf --selector "#viewer-container" localhost-posters-1-preview-1920x0.pdf

As you can see, it's not cropped and sized to match the element as it appears on the page.

I'm going to try to simulate having the pdf format take up the whole page but I've yet to be successful, any ideas?

Thanks.

arifb commented 6 years ago

Yes, it seems pdf also ignores other options, like zoom-factor, whereas they work with other formats.