Webshot custom css

I'm trying to save my website as an image using WebShot with nodeJs. In the documentation it says that WebShot has customCSS option which lets to apply custom css style to a webpage before taking a screenshot. I would like to use that option but when I try to run my file with node it gives me an error of: customCSS:'body { ^^^^^^^ SyntaxError: Unexpected token ILLEGAL

My code is as following:

var options = {
  siteType: "html",
  //defaultWhiteBackground: true,

  customCSS:"body {
    background-color: #b0c4de;
}"

};

webshot(svgsrc,'graphy2.png',options,function(err) {
if(err) {
                console.log('error saving document', err)
            } else {
                console.log('The file was saved!');
            }
}); 

I can save image with no problem is just that I cannot find a way to apply custom css before saving an image, so any help would be appreciated. Thanks

Try this instead (single quoted and in one line):

var options = {
  siteType: 'html',
  customCSS: 'body {background-color: #b0c4de;}'
}

customCSS option not working � Issue #119 � brenden/node-webshot, Doesn't look like the option of customCSS is working. I've looked through all the code and found no mention of it. Is it enabled? With this module you can edit the CSS codes yourself and customize your shop to your desires. WebshopsPOS AppReservationsPricesReviewsLoginSupport. ENEUR. HTML5/CSS custom layout. Creating your design (easy) With the built-in layout editor, you can create a layout by choosing a template and colors.

With reference to: link and this

I found that I needed to specify (for example) :

 -webkit-justify-content

for:

justify-content

Webshot custom css, В документации говорится, что WebShot имеет опцию customCSS, которая позволяет применить пользовательский стиль css к веб-странице перед тем, � Insert your custom CSS code to the current web site and you will see the changes immediately. How to use: 1. Press the extension button to display the CSS editor. 2. Write your custom CSS. 3. Enjoy

you can also escape your lines

var options = {
  siteType: "html",
  //defaultWhiteBackground: true,

  customCSS:"body { \
    background-color: #b0c4de; \
}"

};

Package, node-webshot. Webshot provides a simple API for taking webpage screenshots. customCSS, '', When taking the screenshot, adds custom CSS rules if defined. You can also get screenshots of a portion of a web page using CSS selectors. If there are multiple matches for the CSS selector, it will use the first match. webshot ("https://www.r-project.org/", "r-sidebar.png", selector = ".sidebar") If you supply multiple CSS selectors, it will take a screenshot containing all of the selected items.

Webshot Custom Css, Попробуйте вместо этого (одинарные и в одной строке):. var options = { siteType: 'html', customCSS: 'body {background-color: #b0c4de;}' }. webshot package provides one simple function webshot() that takes a webpage url as its first argument and saves it in the given file name that is its second argument. It is important to note that the filename includes the file extensions like '.jpg', '.png', '.pdf' based on which the output file is rendered.

How to create a screenshot from a website or html with PhantomJS , Node Webshot provides a simple API for taking webpage customCSS, '', When taking the screenshot, adds custom CSS rules if defined. When taking the screenshot, adds custom CSS rules if defined. quality: 75: JPEG compression quality. A higher number will look better, but creates a larger file. Quality setting has no effect when streaming. streamType 'png' If streaming is used, this designates the file format of the streamed rendering.

javascript - Webshot custom css, В документации говорится, что в WebShot есть опция customCSS, которая позволяет применять собственный стиль CSS к веб-странице перед� Cascading Style Sheets (CSS) is used to format the layout of a webpage. With CSS, you can control the color, font, the size of text, the spacing between elements, how elements are positioned and laid out, what background images or background colors to be used, different displays for different devices and screen sizes, and much more!