shot-scraper icon indicating copy to clipboard operation
shot-scraper copied to clipboard

YAML configuration for PDF shots

Open simonw opened this issue 2 years ago • 3 comments

I added PDF support here:

  • #24

But there's currently no way to script PDFs in the YAML syntax with shot-scraper multi. This would be really useful, especially as the PDF generation grows even more options:

  • #26

simonw avatar Mar 12 '22 19:03 simonw

This could work:

- output: example.pdf
  pdf: true
  url: http://www.example.com/

simonw avatar Mar 12 '22 19:03 simonw

Since PDF will accept a different set of options from regular screenshots I think this will be the point at which I add much more robust validation of the YAML mini-language, probably using https://pydantic-docs.helpmanual.io/

simonw avatar Mar 12 '22 19:03 simonw

Hi Simon, I was setup a new repository using your excellent template and was confused when adding shots with a PDF output file failed to render valid PDFs. Would it be worthwhile to mention the formats that are allowed on your detailed documentation page to prevent future confusion about multi-shots? PNG worked great but PDF failed completely.

Additionally, if there is a workaround for Actions multi-shots that you'd recommend for those wishing to generate PDFs, please do let me know. I was thinking of writing a wrapper for myself around shot-scraper pdf that reads a custom YAML file and executes shot-scraper pdf in a subshell.

Thanks for making this great tool!

parkr avatar Feb 25 '24 22:02 parkr