| How to make a graphic that the user can save to a file|
This script demonstrates how to save graphics, embedded inside an e-book, into external files. This is useful is the e-book contains Clip Art or other content that author wishes to provide a save-to-file facility for.
- A picture will typically be embedded in an e-book using something like the following HTML code (where picture.jpg is the name of the picture:
- The follow demonstrates how to make the image clickable. When the image is clicked, the user is prompted whether they would like to save the image (and if so to which file name and folder). If the user decides to save the image, the original file is copied from the e-book to the user's chosen destination:
- Very often in Clip Art type e-books, the author may wish to provide a thumbnail type view of an image, which when clicked saves the original image. This example demonstrates how to do this. In this example, picture.jpg is the name of the image to save, and thumbnail.jpg is the name of the thumbnail image that is displayed within the e-book.
- Incidentally this idea is not specific to graphics, for example, you could just as easily embed a ZIP, PDF, WRI, BMP or any other format the user can copy from within your e-book to their own file using the same principle.
For HTML files (files whose names end with .htm or .html) be sure to set the File Protection for HTML files to Low Security (in the Advanced Security settings dialog box) if using Activ E-Book Compiler 4.20 or later.
- This script has been tested with Activ E-Book Compiler versions 4.00, 4.01, 4.20, 4.21 and 4.22 (4.22 is the latest version at the time of writing). It is possible that changes might be required for e-books made with subsequent versions.