This property defines the rectangular area of the web page to be rasterized when using the requestType of png or jpeg. If no clipping rectangle is set, the entire web page is captured. Beware: if you capture too large an image it can cause your request to fail (out of memory). you can choose any dimensions you wish as long as you do not exceed 32M pixels new for Chrome: as an alternative to clipRect, specify IRenderSettings.selector to automatically set the viewport.
new for Chrome
backend. (not available on WebKit
).
override the CSS media type of the page.
BEWARE: setting custom headers can corrupt your response, making it appear to fail when it did not. use with care.
custom response headers you want sent along with your response.
For example, to rename the file being downloaded,
you can add 'Content-Disposition: attachment; filename="downloaded.pdf"'
IMPORTANT: response headers should not exceed 128Kb
or your API call may fail.
when rendering iFrames, the maximum number of iFrames in total to parse. default is 10
when rendering iFrames, the maximum depth of which to parse. default is 3
new for Chrome
backend. (not available on WebKit
).
If true, and outputting a PNG, will hide the default white background (useful for capturing transparency).
If true and outputting a PDF, will hide the background graphics altogether.
If true, we will pass through all headers received from the target URL.
However, we do not pass through "content-*" and "transfer-*" headers, except for "Content-Type" if you render "html".
Please note: this can potentially corrupt your response, so use with caution.
extraResponseHeaders
override these headers.
new for Chrome
backend. (not available on WebKit
).
if true, will pass the content statusCode, irrespective of if your api call was successful.
Note: you can always check the target URL's status code by inspecting the pjsc-content-status-code
response header.
settings useful for generating PDF's
Note: by default, when generating a PDF we set the IRenderSettings.emulateMedia="screen" property. Consider setting IRenderSettings.emulateMedia="print" for a more print-friendly PDF
optional png quality options passed to PngQuant. you must set pngOptions.optimize=true to enable these, otherwise the original non-modified png is returned.
jpeg quality. 0 to 100. default 70. ignored for png, use pngOptions to set png quality.
new for Chrome
backend. (not available on WebKit
).
as an alternative to clipRectangle
you may pass a CSS selector.
such as "h1", and the bounding rectangle of that element will be used.
CSS selectors are like JQuery. For help, please see https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors
For PlainText or Html, you can pass a selector which will render only the specified element.
For image rendering (jpeg/png) You may also send the send the special "_viewport" selector
note: selector takes precidence over any clipRectangle settings.
how to handle any shadowDom included in the page/iFrames. default is "output".
outputAsJson
:true
or rendering as html
). this is the default.size of the browser in pixels.
for docs and examples, see IRenderSettings.viewport.
This property specifies the scaling factor for the screenshot (requestType png/pdf) choices. The default is 1, i.e. 100% zoom. Use IRenderSettings.viewport.deviceScaleFactor
if you need to control screen DPI
when a page is rendered, use these settings.
Here is an example, but see individual properties for more examples, especially for parameters that are not in this example: