Save as Image WordPress Plugin Reference

Conversion Format

Output Format
The format of the output file.
Allowed values:
  • png
  • jpg
  • gif
  • tiff
  • bmp
  • ico
  • ppm
  • pgm
  • pbm
  • pnm
  • psb
  • pct
  • ras
  • tga
  • sgi
  • sun
  • webp
Default: png
Examples:
  • Plugin settings: Conversion Format tab → Output Format option
    webp
  • Shortcode: output_format
    [save_as_image_pdfcrowd output_format="webp"]
  • PHP function: output_format
    echo create_save_as_image_pdfcrowd_button(array('output_format' => 'webp'));

General Options

Use Print Media
Use the print version of the page if available (@media print).
Default: false
Examples:
  • Plugin settings: General Options tab → Use Print Media checkbox
  • Shortcode: use_print_media
    [save_as_image_pdfcrowd use_print_media=true]
  • PHP function: use_print_media
    echo create_save_as_image_pdfcrowd_button(array('use_print_media' => true));
No Background
Do not print the background graphics.
Default: false
Examples:
  • Plugin settings: General Options tab → No Background checkbox
  • Shortcode: no_background
    [save_as_image_pdfcrowd no_background=true]
  • PHP function: no_background
    echo create_save_as_image_pdfcrowd_button(array('no_background' => true));
Disable JavaScript
Do not execute JavaScript.
Default: false
Examples:
  • Plugin settings: General Options tab → Disable JavaScript checkbox
  • Shortcode: disable_javascript
    [save_as_image_pdfcrowd disable_javascript=true]
  • PHP function: disable_javascript
    echo create_save_as_image_pdfcrowd_button(array('disable_javascript' => true));
Disable Image Loading
Do not load images.
Default: false
Examples:
  • Plugin settings: General Options tab → Disable Image Loading checkbox
  • Shortcode: disable_image_loading
    [save_as_image_pdfcrowd disable_image_loading=true]
  • PHP function: disable_image_loading
    echo create_save_as_image_pdfcrowd_button(array('disable_image_loading' => true));
Disable Remote Fonts
Disable loading fonts from remote sources.
Default: false
Examples:
  • Plugin settings: General Options tab → Disable Remote Fonts checkbox
  • Shortcode: disable_remote_fonts
    [save_as_image_pdfcrowd disable_remote_fonts=true]
  • PHP function: disable_remote_fonts
    echo create_save_as_image_pdfcrowd_button(array('disable_remote_fonts' => true));
Use Mobile User Agent
Use a mobile user agent.
Default: false
Examples:
  • Plugin settings: General Options tab → Use Mobile User Agent checkbox
  • Shortcode: use_mobile_user_agent
    [save_as_image_pdfcrowd use_mobile_user_agent=true]
  • PHP function: use_mobile_user_agent
    echo create_save_as_image_pdfcrowd_button(array('use_mobile_user_agent' => true));
Load Iframes
Specifies how iframes are handled.
Allowed values:
  • all
    All iframes are loaded.
  • same-origin
    Only iframes with the same origin as the main page are loaded.
  • none
    Iframe loading is disabled.
Default: all
Examples:
  • Plugin settings: General Options tab → Load Iframes option
    Iframe loading is disabled.
  • Shortcode: load_iframes
    [save_as_image_pdfcrowd load_iframes="none"]
  • PHP function: load_iframes
    echo create_save_as_image_pdfcrowd_button(array('load_iframes' => 'none'));
Block Ads
Try to block ads. Enabling this option can produce smaller output and speed up the conversion.
Default: false
Examples:
  • Plugin settings: General Options tab → Block Ads checkbox
  • Shortcode: block_ads
    [save_as_image_pdfcrowd block_ads=true]
  • PHP function: block_ads
    echo create_save_as_image_pdfcrowd_button(array('block_ads' => true));
Default Encoding
Set the default HTML content text encoding.
Default: auto detect
Examples:
  • Plugin settings: General Options tab → Default Encoding option
    utf-8
  • Shortcode: default_encoding
    [save_as_image_pdfcrowd default_encoding="utf-8"]
  • PHP function: default_encoding
    echo create_save_as_image_pdfcrowd_button(array('default_encoding' => 'utf-8'));
Locale
Set the locale for the conversion. This may affect the output format of dates, times and numbers.
Default: en-US
Examples:
  • Plugin settings: General Options tab → Locale option
    ja-JP
  • Shortcode: locale
    [save_as_image_pdfcrowd locale="ja-JP"]
  • PHP function: locale
    echo create_save_as_image_pdfcrowd_button(array('locale' => 'ja-JP'));
HTTP Auth User Name
Set the HTTP authentication user name.
Examples:
  • Plugin settings: General Options tab → HTTP Auth User Name option
    John
  • Shortcode: http_auth_user_name
    [save_as_image_pdfcrowd http_auth_user_name="John"]
  • PHP function: http_auth_user_name
    echo create_save_as_image_pdfcrowd_button(array('http_auth_user_name' => 'John'));
HTTP Auth Password
Set the HTTP authentication password.
Examples:
  • Plugin settings: General Options tab → HTTP Auth Password option
    123456
  • Shortcode: http_auth_password
    [save_as_image_pdfcrowd http_auth_password="123456"]
  • PHP function: http_auth_password
    echo create_save_as_image_pdfcrowd_button(array('http_auth_password' => '123456'));
Cookies
Set cookies that are sent in Pdfcrowd HTTP requests.
Examples:
  • Plugin settings: General Options tab → Cookies option
    session=6d7184b3bf35;token=2710
  • Shortcode: cookies
    [save_as_image_pdfcrowd cookies="session=6d7184b3bf35;token=2710"]
  • PHP function: cookies
    echo create_save_as_image_pdfcrowd_button(array('cookies' => 'session=6d7184b3bf35;token=2710'));
Verify SSL Certificates
Do not allow insecure HTTPS connections.
Default: false
Examples:
  • Plugin settings: General Options tab → Verify SSL Certificates checkbox
  • Shortcode: verify_ssl_certificates
    [save_as_image_pdfcrowd verify_ssl_certificates=true]
  • PHP function: verify_ssl_certificates
    echo create_save_as_image_pdfcrowd_button(array('verify_ssl_certificates' => true));
Fail On Main URL Error
Abort the conversion if the main URL HTTP status code is greater than or equal to 400.
Default: false
Examples:
  • Plugin settings: General Options tab → Fail On Main URL Error checkbox
  • Shortcode: fail_on_main_url_error
    [save_as_image_pdfcrowd fail_on_main_url_error=true]
  • PHP function: fail_on_main_url_error
    echo create_save_as_image_pdfcrowd_button(array('fail_on_main_url_error' => true));
Fail On Any URL Error
Abort the conversion if any of the sub-request HTTP status code is greater than or equal to 400 or if some sub-requests are still pending. See details in a debug log.
Default: false
Examples:
  • Plugin settings: General Options tab → Fail On Any URL Error checkbox
  • Shortcode: fail_on_any_url_error
    [save_as_image_pdfcrowd fail_on_any_url_error=true]
  • PHP function: fail_on_any_url_error
    echo create_save_as_image_pdfcrowd_button(array('fail_on_any_url_error' => true));
No X-Pdfcrowd Header
Do not send the X-Pdfcrowd HTTP header in Pdfcrowd HTTP requests.
Default: false
Examples:
  • Plugin settings: General Options tab → No X-Pdfcrowd Header checkbox
  • Shortcode: no_xpdfcrowd_header
    [save_as_image_pdfcrowd no_xpdfcrowd_header=true]
  • PHP function: no_xpdfcrowd_header
    echo create_save_as_image_pdfcrowd_button(array('no_xpdfcrowd_header' => true));
Custom JavaScript
Run a custom JavaScript after the document is loaded and ready to print. The script is intended for post-load DOM manipulation (add/remove elements, update CSS, ...). In addition to the standard browser APIs, the custom JavaScript code can use helper functions from our JavaScript library.
Examples:
  • Plugin settings: General Options tab → Custom JavaScript option
    document.body.style.setProperty('background-color', 'gray', 'important')
  • Shortcode: custom_javascript
    [save_as_image_pdfcrowd custom_javascript="document.body.style.setProperty('background-color', 'gray', 'important')"]
  • PHP function: custom_javascript
    echo create_save_as_image_pdfcrowd_button(array('custom_javascript' => 'document.body.style.setProperty("background-color", "gray", "important")'));
On Load JavaScript
Run a custom JavaScript right after the document is loaded. The script is intended for early DOM manipulation (add/remove elements, update CSS, ...). In addition to the standard browser APIs, the custom JavaScript code can use helper functions from our JavaScript library.
Examples:
  • Plugin settings: General Options tab → On Load JavaScript option
    document.body.style.setProperty('background-color', 'gray', 'important')
  • Shortcode: on_load_javascript
    [save_as_image_pdfcrowd on_load_javascript="document.body.style.setProperty('background-color', 'gray', 'important')"]
  • PHP function: on_load_javascript
    echo create_save_as_image_pdfcrowd_button(array('on_load_javascript' => 'document.body.style.setProperty("background-color", "gray", "important")'));
Custom HTTP Header
Set a custom HTTP header that is sent in Pdfcrowd HTTP requests.
Constraint:
  • A string containing the header name and value separated by a colon.
Examples:
  • Plugin settings: General Options tab → Custom HTTP Header option
    X-My-Client-ID:k2017-12345
  • Shortcode: custom_http_header
    [save_as_image_pdfcrowd custom_http_header="X-My-Client-ID:k2017-12345"]
  • PHP function: custom_http_header
    echo create_save_as_image_pdfcrowd_button(array('custom_http_header' => 'X-My-Client-ID:k2017-12345'));
JavaScript Delay
Wait the specified number of milliseconds to finish all JavaScript after the document is loaded. Your API license defines the maximum wait time by "Max Delay" parameter.
Constraint:
  • Must be a positive integer number or 0.
Default: 200
Examples:
  • Plugin settings: General Options tab → JavaScript Delay option
    2000
  • Shortcode: javascript_delay
    [save_as_image_pdfcrowd javascript_delay=2000]
  • PHP function: javascript_delay
    echo create_save_as_image_pdfcrowd_button(array('javascript_delay' => 2000));
Element To Convert
Convert only the specified element from the main document and its children. The element is specified by one or more CSS selectors. If the element is not found, the conversion fails. If multiple elements are found, the first one is used.
Examples:
  • Plugin settings: General Options tab → Element To Convert option
    div.user-panel.main p.article
  • Shortcode: element_to_convert
    [save_as_image_pdfcrowd element_to_convert="div.user-panel.main p.article"]
  • PHP function: element_to_convert
    echo create_save_as_image_pdfcrowd_button(array('element_to_convert' => 'div.user-panel.main p.article'));
Element To Convert Mode
Specify the DOM handling when only a part of the document is converted. This can affect the CSS rules used.
Allowed values:
  • cut-out
    The element and its children are cut out of the document.
  • remove-siblings
    All element's siblings are removed.
  • hide-siblings
    All element's siblings are hidden.
Default: cut-out
Examples:
  • Plugin settings: General Options tab → Element To Convert Mode option
    All element's siblings are hidden.
  • Shortcode: element_to_convert_mode
    [save_as_image_pdfcrowd element_to_convert_mode="hide-siblings"]
  • PHP function: element_to_convert_mode
    echo create_save_as_image_pdfcrowd_button(array('element_to_convert_mode' => 'hide-siblings'));
Wait For Element
Wait for the specified element in a source document. The element is specified by one or more CSS selectors. The element is searched for in the main document and all iframes. If the element is not found, the conversion fails. Your API license defines the maximum wait time by "Max Delay" parameter.
Examples:
  • Plugin settings: General Options tab → Wait For Element option
    div.user-panel.main p.article
  • Shortcode: wait_for_element
    [save_as_image_pdfcrowd wait_for_element="div.user-panel.main p.article"]
  • PHP function: wait_for_element
    echo create_save_as_image_pdfcrowd_button(array('wait_for_element' => 'div.user-panel.main p.article'));
Auto Detect Element To Convert
The main HTML element for conversion is detected automatically.
Default: false
Examples:
  • Plugin settings: General Options tab → Auto Detect Element To Convert checkbox
  • Shortcode: auto_detect_element_to_convert
    [save_as_image_pdfcrowd auto_detect_element_to_convert=true]
  • PHP function: auto_detect_element_to_convert
    echo create_save_as_image_pdfcrowd_button(array('auto_detect_element_to_convert' => true));
Readability Enhancements
The input HTML is automatically enhanced to improve the readability.
Allowed values:
  • none
    No enhancements are used.
  • readability-v1
    Version 1 of the enhancements is used.
  • readability-v2
    Version 2 of the enhancements is used.
  • readability-v3
    Version 3 of the enhancements is used.
  • readability-v4
    Version 4 of the enhancements is used.
Default: none
Examples:
  • Plugin settings: General Options tab → Readability Enhancements option
    Version 4 of the enhancements is used.
  • Shortcode: readability_enhancements
    [save_as_image_pdfcrowd readability_enhancements="readability-v4"]
  • PHP function: readability_enhancements
    echo create_save_as_image_pdfcrowd_button(array('readability_enhancements' => 'readability-v4'));

Image Output

Screenshot Width
Set the output image width in pixels.
Constraint:
  • The value must be in the range 96-65000.
Default: 1024
Examples:
  • Plugin settings: Image Output tab → Screenshot Width option
    1920
  • Shortcode: screenshot_width
    [save_as_image_pdfcrowd screenshot_width=1920]
  • PHP function: screenshot_width
    echo create_save_as_image_pdfcrowd_button(array('screenshot_width' => 1920));
Screenshot Height
Set the output image height in pixels. If it is not specified, actual document height is used.
Constraint:
  • Must be a positive integer number.
Examples:
  • Plugin settings: Image Output tab → Screenshot Height option
    1080
  • Shortcode: screenshot_height
    [save_as_image_pdfcrowd screenshot_height=1080]
  • PHP function: screenshot_height
    echo create_save_as_image_pdfcrowd_button(array('screenshot_height' => 1080));
Scale Factor
Set the scaling factor (zoom) for the output image.
Constraint:
  • Must be a positive integer number.
Default: 100
Examples:
  • Plugin settings: Image Output tab → Scale Factor option
    50
  • Shortcode: scale_factor
    [save_as_image_pdfcrowd scale_factor=50]
  • PHP function: scale_factor
    echo create_save_as_image_pdfcrowd_button(array('scale_factor' => 50));
Background Color
The output image background color.
Constraint:
  • The value must be in RRGGBB or RRGGBBAA hexadecimal format.
Examples:
  • Plugin settings: Image Output tab → Background Color option
    00ff00
  • Shortcode: background_color
    [save_as_image_pdfcrowd background_color="00ff00"]
  • PHP function: background_color
    echo create_save_as_image_pdfcrowd_button(array('background_color' => '00ff00'));

Data

Methods related to HTML template rendering.

Data String
Set the input data for template rendering. The data format can be JSON, XML, YAML or CSV.
Examples:
  • Plugin settings: Data tab → Data String option
    {"recipient": "Anna May", "sender": "John Doe"}
  • Shortcode: data_string
    [save_as_image_pdfcrowd data_string="{'recipient': 'Anna May', 'sender': 'John Doe'}"]
  • PHP function: data_string
    echo create_save_as_image_pdfcrowd_button(array('data_string' => '{"recipient": "Anna May", "sender": "John Doe"}'));
Data File
Load the input data for template rendering from the specified file. The data format can be JSON, XML, YAML or CSV.
Examples:
  • Plugin settings: Data tab → Data File option
    /home/user/john/data.json
  • Shortcode: data_file
    [save_as_image_pdfcrowd data_file="/home/user/john/data.json"]
  • PHP function: data_file
    echo create_save_as_image_pdfcrowd_button(array('data_file' => '/home/user/john/data.json'));
Data Format
Specify the input data format.
Allowed values:
  • auto
    the data format is auto detected
  • json
  • xml
  • yaml
  • csv
Default: auto
Examples:
  • Plugin settings: Data tab → Data Format option
    csv
  • Shortcode: data_format
    [save_as_image_pdfcrowd data_format="csv"]
  • PHP function: data_format
    echo create_save_as_image_pdfcrowd_button(array('data_format' => 'csv'));
Data Encoding
Set the encoding of the data file set by setDataFile.
Default: utf-8
Examples:
  • Plugin settings: Data tab → Data Encoding option
    iso8859-2
  • Shortcode: data_encoding
    [save_as_image_pdfcrowd data_encoding="iso8859-2"]
  • PHP function: data_encoding
    echo create_save_as_image_pdfcrowd_button(array('data_encoding' => 'iso8859-2'));
Data Ignore Undefined
Ignore undefined variables in the HTML template. The default mode is strict so any undefined variable causes the conversion to fail. You can use {% if variable is defined %} to check if the variable is defined.
Default: false
Examples:
  • Plugin settings: Data tab → Data Ignore Undefined checkbox
  • Shortcode: data_ignore_undefined
    [save_as_image_pdfcrowd data_ignore_undefined=true]
  • PHP function: data_ignore_undefined
    echo create_save_as_image_pdfcrowd_button(array('data_ignore_undefined' => true));
Data Auto Escape
Auto escape HTML symbols in the input data before placing them into the output.
Default: false
Examples:
  • Plugin settings: Data tab → Data Auto Escape checkbox
  • Shortcode: data_auto_escape
    [save_as_image_pdfcrowd data_auto_escape=true]
  • PHP function: data_auto_escape
    echo create_save_as_image_pdfcrowd_button(array('data_auto_escape' => true));
Data Trim Blocks
Auto trim whitespace around each template command block.
Default: false
Examples:
  • Plugin settings: Data tab → Data Trim Blocks checkbox
  • Shortcode: data_trim_blocks
    [save_as_image_pdfcrowd data_trim_blocks=true]
  • PHP function: data_trim_blocks
    echo create_save_as_image_pdfcrowd_button(array('data_trim_blocks' => true));
Data Options
Set the advanced data options:
  • csv_delimiter - The CSV data delimiter, the default is ,.
  • xml_remove_root - Remove the root XML element from the input data.
  • data_root - The name of the root element inserted into the input data without a root node (e.g. CSV), the default is data.
Examples:
  • Plugin settings: Data tab → Data Options option
    xml_remove_root=1
  • Shortcode: data_options
    [save_as_image_pdfcrowd data_options="xml_remove_root=1"]
  • PHP function: data_options
    echo create_save_as_image_pdfcrowd_button(array('data_options' => 'xml_remove_root=1'));

Miscellaneous

Debug Log
Turn on the debug logging. Details about the conversion are stored in the debug log. The debug log is available in conversion statistics.
Default: false
Examples:
  • Plugin settings: Miscellaneous tab → Debug Log checkbox
  • Shortcode: debug_log
    [save_as_image_pdfcrowd debug_log=true]
  • PHP function: debug_log
    echo create_save_as_image_pdfcrowd_button(array('debug_log' => true));
Tag
Tag the conversion with a custom value. The tag is used in conversion statistics. A value longer than 32 characters is cut off.
Examples:
  • Plugin settings: Miscellaneous tab → Tag option
    client-1234
  • Shortcode: tag
    [save_as_image_pdfcrowd tag="client-1234"]
  • PHP function: tag
    echo create_save_as_image_pdfcrowd_button(array('tag' => 'client-1234'));
HTTP Proxy
A proxy server used by Pdfcrowd conversion process for accessing the source URLs with HTTP scheme. It can help to circumvent regional restrictions or provide limited access to your intranet.
Constraint:
  • The value must have format DOMAIN_OR_IP_ADDRESS:PORT.
Examples:
  • Plugin settings: Miscellaneous tab → HTTP Proxy option
    113.25.84.10:33333
  • Shortcode: http_proxy
    [save_as_image_pdfcrowd http_proxy="113.25.84.10:33333"]
  • PHP function: http_proxy
    echo create_save_as_image_pdfcrowd_button(array('http_proxy' => '113.25.84.10:33333'));
HTTPS Proxy
A proxy server used by Pdfcrowd conversion process for accessing the source URLs with HTTPS scheme. It can help to circumvent regional restrictions or provide limited access to your intranet.
Constraint:
  • The value must have format DOMAIN_OR_IP_ADDRESS:PORT.
Examples:
  • Plugin settings: Miscellaneous tab → HTTPS Proxy option
    113.25.84.10:44333
  • Shortcode: https_proxy
    [save_as_image_pdfcrowd https_proxy="113.25.84.10:44333"]
  • PHP function: https_proxy
    echo create_save_as_image_pdfcrowd_button(array('https_proxy' => '113.25.84.10:44333'));
Client Certificate
A client certificate to authenticate Pdfcrowd converter on your web server. The certificate is used for two-way SSL/TLS authentication and adds extra security.
Constraint:
  • The file must exist and not be empty.
Examples:
  • Plugin settings: Miscellaneous tab → Client Certificate option
    /home/user/john/pdfcrowd.crt
  • Shortcode: client_certificate
    [save_as_image_pdfcrowd client_certificate="/home/user/john/pdfcrowd.crt"]
  • PHP function: client_certificate
    echo create_save_as_image_pdfcrowd_button(array('client_certificate' => '/home/user/john/pdfcrowd.crt'));
Client Certificate Password
A password for PKCS12 file with a client certificate if it is needed.
Examples:
  • Plugin settings: Miscellaneous tab → Client Certificate Password option
    123456
  • Shortcode: client_certificate_password
    [save_as_image_pdfcrowd client_certificate_password="123456"]
  • PHP function: client_certificate_password
    echo create_save_as_image_pdfcrowd_button(array('client_certificate_password' => '123456'));

API Client Options

Converter Version
Set the converter version. Different versions may produce different output. Choose which one provides the best output for your case.
Allowed values:
  • latest
    The latest converter version.
  • 20.10
    Version 20.10.
  • 18.10
    Version 18.10.
Default: 20.10
Examples:
  • Plugin settings: API Client Options tab → Converter Version option
    Version 18.10.
  • Shortcode: converter_version
    [save_as_image_pdfcrowd converter_version="18.10"]
  • PHP function: converter_version
    echo create_save_as_image_pdfcrowd_button(array('converter_version' => '18.10'));
Use HTTP
Specifies if the client communicates over HTTP or HTTPS with Pdfcrowd API.
Default: false

Warning

Using HTTP is insecure as data sent over HTTP is not encrypted. Enable this option only if you know what you are doing.

Examples:
  • Plugin settings: API Client Options tab → Use HTTP checkbox
  • Shortcode: use_http
    [save_as_image_pdfcrowd use_http=true]
  • PHP function: use_http
    echo create_save_as_image_pdfcrowd_button(array('use_http' => true));
Retry Count
Specifies the number of automatic retries when the 502 HTTP status code is received. The 502 status code indicates a temporary network issue. This feature can be disabled by setting to 0.
Default: 1
Examples:
  • Plugin settings: API Client Options tab → Retry Count option
    3
  • Shortcode: retry_count
    [save_as_image_pdfcrowd retry_count=3]
  • PHP function: retry_count
    echo create_save_as_image_pdfcrowd_button(array('retry_count' => 3));