This package hides a lot of the screenshot arguments available in puppeteer. Can they be exposed?
`
page.screenshot([options])
options Options object which might have the following properties:
path The file path to save the image to. The screenshot type will be inferred from file extension. If path is a relative path, then it is resolved relative to current working directory. If no path is provided, the image won't be saved to the disk.
type Specify screenshot type, can be either jpeg or png. Defaults to 'png'.
quality The quality of the image, between 0-100. Not applicable to png images.
fullPage When true, takes a screenshot of the full scrollable page. Defaults to false.
clip An object which specifies clipping region of the page. Should have the following fields:
x x-coordinate of top-left corner of clip area
y y-coordinate of top-left corner of clip area
width width of clipping area
height height of clipping area
omitBackground Hides default white background and allows capturing screenshots with transparency. Defaults to false.
encoding The encoding of the image, can be either base64 or binary. Defaults to binary.
returns: <Promise<string|Buffer>> Promise which resolves to buffer or a base64 string (depending on the value of encoding) with captured screenshot.
`
Hi @kashyap-aditya
As you can see in the README some of these options are already implemented like path, type, quality, encoding and omitBackground that as been renamed transparent. There are only two missing options in your list that are fullPage and clip. Do you need these and would you like to implement them? Does this PR is a good replacement for the clip option?
@kashyap-aditya what is your usecase? Does targeting a specific element in the dom would fulfill the need of the clip option instead of the original which seems not simple to use for me?
@kashyap-aditya I released a new version that let you screenshot a specific element in the dom. I close this issue, feel free to reopen it if it does not fit with your need.
Owner Name | frinyvonnick |
Repo Name | node-html-to-image |
Full Name | frinyvonnick/node-html-to-image |
Language | TypeScript |
Created Date | 2019-12-05 |
Updated Date | 2022-08-08 |
Star Count | 545 |
Watcher Count | 7 |
Fork Count | 78 |
Issue Count | 20 |