- PhantomJS - Home
- PhantomJS - Overview
- PhantomJS - Environment Setup
- PhantomJS - Object
- PhantomJS - Methods
- PhantomJS - Properties
- PhantomJS - Methods
- PhantomJS - Events/Callbacks
- PhantomJS - Child Process Module
- File System Module
- PhantomJS - Properties
- PhantomJS - Methods
- System Module
- PhantomJS - Properties
- Web Server Module
- PhantomJS - Properties
- PhantomJS - Methods
- Miscellaneous
- Command Line Interface
- PhantomJS - Screen Capture
- PhantomJS - Page Automation
- PhantomJS - Network Monitoring
- PhantomJS - Testing
- PhantomJS - REPL
- PhantomJS - Examples
- PhantomJS Useful Resources
- PhantomJS - Quick Guide
- PhantomJS - Useful Resources
- PhantomJS - Discussion
PhantomJS - zoomFactor Property
This property specifies the zoom factor for render and renderBase64 methods. It helps to zoom a page and take a screen capture if required. Value higher than 1 will increase the size of the page and less than 1 decreases.
Syntax
Its syntax is as follows −
var wpage = require('webpage').create();
wpage.zoomFactor;
Example
The following example shows the use of zoomFactor property.
var wpage = require('webpage').create();
wpage.zoomFactor = 0.3;
wpage.open("http://www.google.com", function (status) {
window.setTimeout(function () {
wpage.render('output.png');
phantom.exit();
}, 200);
});
The above program generates the following output.
phantomjs_webpage_module_properties.htm
Advertisements