Answers on MegaZine3 related questions

How to add a "PDF Download" Button?

The easiest is to use the "feature" of the printpdf plugin. With the parameter printpdf you can set the path to your pdf file, and with the parameter printpdfsaveonly set to "true", the printpdf button works as a download button for the pdf file defined with printpdf.
This helps to easily add a pdf download button to the navigation bar.
You can substitute the default icon with your own one (in megazine/gui/printpdf/btn_printpdf.png). But the file to download is fix as configured with the parameter printpdf.

If you want to add additional "buttons" on certain pages, you could also add an image somewhere on that page, and point with the url element (the links plugin is needed for this) to the respective pdf file. Then that "image" would act as a button.

If you prefer an indicator for hover over, you can use overlay or area.

If such "pragmatic" approach is not satisfying fully your needs, you can design and add your own buttons using ASUL. Define the <style> of your button like:

<style>
      button.pdf_download box { background: image(gui/navigationbar/btn_pdf_download.png);}
</style>[/code]

And within the <script> tag add the button to the navigationbar box like:

</script>
	<!-- Description of the navigation bar -->
	<box id="navigationframe" anchors="0,0,pw,ph">
		<!-- Container for the page buttons. -->
...
...
			<!-- PDF Download Button -->
			<button url="file://www.your_domain.com/pdf_path/your_pdf_file.pdf" title="Download my_pdf" style="common pdf_download" width="60"/>
        </box>
</script>

All that goes into the navigationbar.asul. With width set to a different value than the default of 25 pixel, you can make a wider button. You also can "style" your button as you like.
The code sample above is not tested, but most probably should  work ;-)

For details see the WIKI, like on these pages:
ASUL document
Asul scripting
ASUL layouting
Editing the GUI
Buttons

This "scratches the options you have. There are more like setting variables with JS in the index file that you later read in with ActionScript to pass a book specific download path. Just to give you an idea...

Last update on 28.07.2011 by Hans Nuecke.

Go back