Pearl Crescent
Page Saver Basic & Pro Documentation |
Pearl Crescent Page Saver Documentation
(Basic & Pro Editions)
Using the Page Saver
Toolbar Item
After you install the Basic or Pro edition of Page Saver and restart
Firefox, a new “Save As Image” item appears on the Firefox navigation toolbar
(the toolbar item’s icon looks like a camera). See Figure 1.
To save an image of a web page, click on the toolbar item. By default,
a PNG-format image of the entire page is saved to a
local file. This behavior may be changed by adjusting the Page Saver
options as described below, or by holding down one of
the following modifier keys as you click on the toolbar item:
You may also use the menu associated with the Page Saver toolbar item
to save images of pages (see Figure 2). Choose one of the following
menu items:
If the page you are viewing contains any frames or iframes, the Save Image of Entire Frame item will provide a menu that contains a list of each top-level frame on the page that may be captured. Check the Arrange to Capture Flash Content menu item to have Page Saver alter certain pages as they load to make it possible to capture the Flash content. Enabling this feature may cause some pages that contain Flash content to load incorrectly. Learn more. PROIn Page Saver Pro, you may also use the toolbar menu to choose a destination for the image (a local file, your computer’s clipboard, or, if configured, an FTP, HTTP, or HTTPS server). The toolbar menu also contains a Send Feedback... item which takes you to a form on the Pearl Crescent web site and a Page Saver Options... item which may be used to open the options window. To change the position of the toolbar item or remove it entirely, choose Customize... from the “hamburger” menu or, if you have a menu bar, choose View | Toolbars | Customize.... Using the Browser Context
Menu
Page Saver adds the following browser context menu items to Firefox:
To hide one or more of the Page Saver context menu items, uncheck the appropriate checkbox on the Page Saver options window’s General tab. PROSelecting
and Capturing a Region on a Page
In Page Saver Pro, you may select and capture a rectangular region on a page
by holding down the Ctrl key (Windows and Linux) or
Command key (Mac OS) while you click on
the Page Saver toolbar item. Alternatively, you may choose the
Save Image of Region You Select... command from
one of the Page Saver menus.
The contents of the page will be dimmed and a large “cross hair” mouse pointer will appear along with the position of the cross hair. You can then click and drag the mouse to highlight a region on the page (note you cannot scroll the page during the capture). After you release the mouse button, you may adjust the size and position of the region. During this process, the dimensions of the region to be captured are displayed. Click and drag the “grab handles” along the edges of the region to resize it. To reposition the selected region, click inside it and drag it with the mouse or use the Left Arrow, Right Arrow, Up Arrow, and Down Arrow keys to “nudge” it one pixel at a time (hold down the shift key while pressing an arrow key to move it 10 pixels at a time). To complete the capture, click the Capture button or press the Enter key or Return key. To cancel the capture, press the Esc key. Figure 3 shows a screenshot of the region capture process. You may also view a video demonstration. From the Page Saver option window’s General tab, you may make capturing a region the default action and you may add a keyboard shortcut. Refer to the next section (Customizing Page Saver) for more information. Customizing Page Saver
You may customize Page Saver’s behavior by adjusting various options.
Use one of the following two methods to open the Page Saver options window:
Use the Image Capture tab (shown in Figure 5) to specify a pattern for file names, to choose whether or not to be prompted for the file name and location (and to specify a destination directory if not prompted), to choose whether or not to overwrite existing local files, to limit the size of saved images, to set the image format and its corresponding options, and to choose whether a sound is played after capturing each image. You can arrange to capture Flash content by checking the appropriate box. Learn more.
The file name pattern is used by Page Saver to construct the file name.
The following character sequences are replaced with values taken from the
page title, page URL, and the date and time of the capture:
If the “Prompt before saving to a local file” radio button is selected, Page Saver will ask during each capture for a file name and destination directory. If the “Save files to” radio button is selected, you will not be prompted; in this case, you may configure a destination directory. If the overwrite checkbox is checked, existing files are overwritten without prompting; if it is not checked, Page Saver will generate a unique file name by appending (1), (2), etc. to the name. The overwrite option is only consulted if the “Save files to” radio button is selected or if Page Saver is invoked from the command line.
If JPEG format is chosen, you may specify the image quality which is an integer value that ranges from 0 to 100 (with 100 providing the best quality). Since JPEG uses lossy compression while PNG uses lossless compression, PNG is a better choice when a high quality image is needed. Page Saver will truncate very long file path names to avoid problems when saving images to a file. There is a hidden preference named extensions.pagesaver.file.name.maxlength that may be modified to change the maximum length of the file paths that Page Saver generates. Hidden preferences may be modified using Firefox’s about:config advanced configuration editor.
PROIn Page Saver Pro, use the
Header and Footer tab (shown in Figure 6) to
include a header or footer in each captured image.
The header and footer text patterns accept the same formatting characters as the file name pattern (located on the Image Capture tab). There are also four hidden preferences that control the height and text format for the header and footer:
PROIn
Page Saver Pro, use the
Destination tab (shown in Figure 7) to choose
a destination for captured images (a local file, your computer’s clipboard,
or a server), and to enter the location, user name, and password for an
HTTP, HTTPS, or FTP server. HTTP servers must be configured to accept
PUT requests.
By default, Page Saver will append a file name to the URL before uploading each captured image. However, if the URL ends with .png, .jpg, or .jpeg it will used “as is” and all captured images will be uploaded to the same location.
Using Page Saver from the
Command Line
To save an image of an entire web page from the command line, use the
-saveimage flag. For example:
firefox -saveimage https://www.mozilla.org/ ? or & that will be interpreted by
your command shell. For example:
firefox -saveimage "https://www.google.com/search?q=Page%20Saver&ie=utf-8&oe=utf-8" By default, images captured from the command line are saved to Firefox’s Download Folder. You can set this location from the Downloads section of the Firefox Options window. In Page Saver Pro, the -saveas command line flag may be used to specify the file path where images are saved (see below). If Firefox is not running, it will exit after saving the image. On Mac OS, it is generally better to run firefox-bin rather than firefox (which is a script that starts firefox-bin). For more information about using Firefox from the command line, refer to this mozillaZine article. The following sections provide additional information about using Page Saver from the command line:
Controlling the
Command Line Image Capture Process
To control the size of the browser window that is opened, use the -width and -height flags to specify the window width and height in pixels. For example: firefox -saveimage https://www.mozilla.org/ -width 800 -height 600 To specify a delay before capturing a page, use the -savedelay flag (this is useful for pages that add content after the initial page load is complete). The delay specified is in milliseconds. For example, to specify a one second delay, use a command such as: firefox -saveimage https://www.mozilla.com/ -savedelay 1000 To capture Flash content, include the -captureflash flag (this is an alternative to checking the arrange to capture Flash content box in the Page Saver Options). For example: firefox -saveimage https://www.adobe.com/ -savedelay 1000 -captureflash PROIn Page Saver Pro, use the flashdelay option (part of the -saveoptions) to specify an additional delay before capturing a page that contains Flash content. Learn more. PROIn Page Saver Pro, include the -saveas flag on the command line to specify a directory, a file, or a server location (URL) where the image will be saved. You may also specify the word clipboard to place a copy of the captured image on the system clipboard. Here is an example that uses a file path: firefox -saveimage https://www.mozilla.org/ -saveas /tmp/moz.png c:\moz.png and on Linux and Mac OS X you should use
a path like /tmp/moz.png .
You may also use a file name pattern to specify the file name. For example, to include the page title in the file name, use a command like this: firefox -saveimage https://pearlcrescent.com/ -saveas "/tmp/%t.png" To save to the clipboard, use a command like this: firefox -saveimage https://www.mozilla.org/ -saveas clipboard To upload the captured image to a server, specify an ftp://, http://, or https:// URL using the -saveas flag. If a password is needed and it has not been saved in the Firefox Password Manager, you will need to include the password in the URL. For example: firefox -saveimage https://flickr.com/ -saveas ftp://joe:secret@example.com/upload/ By default, Page Saver will append a file name to the URL before uploading the captured image using FTP or HTTP PUT. However, if the URL ends with .png, .jpg, or .jpeg it will be used “as is” to upload to a specific file. For example, to upload a captured image to a file named img42.png, use a command similar to the following: firefox -saveimage https://flickr.com/ -saveas https://example.com/img42.png
PROIn Page Saver Pro, the
-saveoptions command line flag may be used to
control additional aspects of the image capture process. Separate
multiple options with a comma. For example:
firefox -saveimage https://www.amazon.com/ -saveoptions visible,delay=2000,scale=50%
Additional Command Line
Examples
Save an image of the getfirefox.com page using a browser window that is
1024x768 pixels in size, waiting 1/2 a second after the page loads before
capturing it:
firefox -saveimage https://getfirefox.com/ -width 1024 -height 768 -savedelay 500
PROSave a 300 pixel thumbnail image of the
visible portion of the mozilla.org page using a browser window that is
800x600 pixels in size. The original URL (http://mozilla.org/) will be
used to replace %u within the file name
specified via the -saveas flag.
firefox -saveimage http://mozilla.org/ -width 800 -height 600 -saveoptions visible,useoriginalurl,scale=300 -saveas /tmp/%u.png
PROSave an image of the “top tags”
portion of the Technorati main page to a file named /tmp/toptags.png:
firefox -saveimage http://technorati.com/ -saveoptions element=sb-toptags -saveas /tmp/toptags.png
PROSave a high quality JPEG image of a Flickr
page that shows photos tagged with the term “lighthouse”:
firefox -saveimage http://flickr.com/photos/tags/lighthouse/ -saveoptions format=jpeg@quality=100
PROPlace an image of the Apple, Inc. Yahoo!
Finance page on the system clipboard:
firefox -saveimage "https://finance.yahoo.com/q?s=AAPL" -saveas clipboard
PROUpload a half-size image of the top 500
pixels of the Google News page to an HTTP server:
firefox -saveimage https://news.google.com/ -saveoptions bottom=500,scale=50% -saveas http://jill:secret@example.com/myfiles/
PROCapture an image to the clipboard.
If the page contains Flash content, wait 5 seconds before capturing; if not,
wait only 2 seconds:
firefox -saveimage http://www.adobe.com/ -savedelay 2000 -saveoptions flashdelay=3000
Determining Whether a
Capture Succeeded
Each time Page Saver is run from the command line, it will write a one-line status message to the standard error stream. The status message will consist of the text PageSaver:CaptureComplete followed by an integer result code and an optional text string that provides more detailed information. For example, for a successful capture the message might look like this: PageSaver:CaptureComplete 0 (success)-HTTP:200 You may use the -savelog flag to send the Page Saver status messages to a file. For example: firefox -saveimage https://www.mozilla.org/ -savelog /tmp/capturelog.txt On Microsoft Windows, you must start Firefox with a -savelog flag or with the -console flag to see the Page Saver status messages. Since Page Saver opens a new window for each capture and closes it after the capture is done, while you are experimenting with various Page Saver command line flags you may want to first start a copy of Firefox with the -savelog or -console flags only and then run additional Firefox commands that include Page Saver options. For example:
cd "c:\Program Files\Mozilla Firefox" Table 1 lists all of the the result codes that may be returned in the PageSaver:CaptureComplete messages.
Here is another example: if the -saveas option is used in Page Saver Pro and an invalid file path is provided, the status line will contain a result code of 7: PageSaver:CaptureComplete 7 (failure)-[Exception... NS_ERROR_FILE_NOT_FOUND ...] Extra Information Provided
with Result Code 0 (Success)
For successful requests, the PageSaver:CaptureComplete message will include the HTTP status code (if available) in the form HTTP:statuscode (where statuscode is replaced by 200, 404, and so on). In addition, if a page was too large to capture in its entirety, the text imagecropped will be included (separated from other information with a comma). For more information about image capture size limitations, see the section Known Issues and Limitations. If the meta-refresh maximum wait time was exceeded, the text refreshmaxwait will be included (separated from other information by a comma). If the maximum page load time was exceeded, the text maxwait will be included (separated from other information by a comma). For example: PageSaver:CaptureComplete 0 (success)-HTTP:200,maxwait
Extra Information Provided
with Result Code 12 (Request Error)
When a command line capture fails with Result Code 12 (request error), the PageSaver:CaptureComplete message will include detailed error information. First, a hexadecimal Mozilla error code will be output. For common errors, the name of the error will also be output. Here are some examples:
PageSaver:CaptureComplete 12 (failure)-0x804b001e NS_ERROR_UNKNOWN_HOST
The most common Mozilla errors are defined in these two source code files: Known Issues and
Limitations
Other Information
Page Saver Basic Extension GUID:
{c151d79e-e61b-4a90-a887-5a46d38fba99}
Page Saver Pro Extension GUID:
{7e5323bb-4c75-4c7e-8383-612a65a6d61e}
Authors and Translators:
|
||||||||||||||||||||||||
Subscribe to our announcement list. |