Commit 7a83beaf 7a83beaf0c27373c5a681dbc06e9e09c6461ae37 by Nicolas Perriault

added docs for new capture*() imgOptions parameter

1 parent 9da6a3aa
......@@ -496,7 +496,7 @@ Clicks on the first DOM element found containing ``label`` text. Optionaly ensur
``capture()``
-------------------------------------------------------------------------------
**Signature:** ``capture(String targetFilepath, Object clipRect)``
**Signature:** ``capture(String targetFilepath, [Object clipRect, Object imgOptions])``
Proxy method for PhantomJS' ``WebPage#render``. Adds a ``clipRect`` parameter for automatically setting page ``clipRect`` setting and reverts it back once done::
......@@ -511,6 +511,22 @@ Proxy method for PhantomJS' ``WebPage#render``. Adds a ``clipRect`` parameter fo
casper.run();
.. versionadded:: 1.1
The ``imgOptions`` object allows to specify two options:
- ``format`` to set the image format manually, avoiding relying on the filename
- ``quality`` to set the image quality, from 1 to 100
Example::
casper.start('http://foo', function() {
this.capture('foo', undefined, {
format: 'jpg',
quality: 75
});
});
.. index:: screenshot, Base64
``captureBase64()``
......@@ -555,7 +571,7 @@ Example::
``captureSelector()``
-------------------------------------------------------------------------------
**Signature:** ``captureSelector(String targetFile, String selector)``
**Signature:** ``captureSelector(String targetFile, String selector [, Object imgOptions])``
Captures the page area containing the provided selector and saves it to ``targetFile``::
......@@ -565,6 +581,13 @@ Captures the page area containing the provided selector and saves it to ``target
casper.run();
.. versionadded:: 1.1
The ``imgOptions`` object allows to specify two options:
- ``format`` to set the image format manually, avoiding relying on the target filename
- ``quality`` to set the image quality, from 1 to 100
``clear()``
-------------------------------------------------------------------------------
......