Input

book: Create a structured PDF document with headings, chapters, etc.
webpage: Specifies that the HTML sources are unstructured (plain web pages.) A page break is inserted between each file or URL in the output.
continuous: Specifies that the HTML sources are unstructured (plain web pages.) No page breaks are inserted between each file or URL in the output.
Title of the document for the front page.
Extract the first heading of the document and use it as title. If checked the title field has no effect.
The title image or HTML page. These file has to be an attachments!
Specify document version to be displayed on the title page.
Intellectual property owner of this document.
Copyright notice for this document.
Information about who and when modified the document are applied at the end.

Output

Specifies the output format.
Grayscale document  Title page
Compression :   JPEG big images 

Pagina

 
User defined page size 
Choose one of the predefined standard sizes or select user defined.
Specifies the page size using a standard name or in points (no suffix or ##x##pt), inches (##x##in), centimeters (##x##cm), or millimeters (##x##mm).
Set the target browser width in pixels (400-1200). This determines the page scaling of images.
   2-Sided   Landscape
   
   
   
Specifies the margin size using points (no suffix or ##x##pt), inches (##x##in), centimeters (##x##cm), or millimeters (##x##mm). Keep empty for default value.
Left
Middle
Right
Sets the page header to use on body pages.
Left
Middle
Right
Sets the page footer to use on body pages.

Indice

Sets the number of levels in the table-of-contents. Empty for unlimited levels.
   Numbered headings Check to number all of the headings in the document.
Sets the title for the table-of-contents. Empty for default title.
Left
Middle
Right
Sets the page header to use on table-of-contents pages.
Left
Middle
Right
Sets the page footer to use on table-of-contents pages.

Colors

Enter the HTML color for the body (background).
Enter the image file for the body (background). These file has to be an attachments!
Enter the HTML color for the text.
Sets the color of links.
Enables generation of links in PDF files.

Fonts

Set the default size of text.
Set the spacing between lines of text.
Choose the default typeface (font) of text.
Choose the default typeface (font) of headings.
Set the size of header and footer text.
Choose the font for header and footer text.
Change the encoding of the text in document.
Check to embed font in the output file.

PDF

Controls the initial viewing mode for the document.
Document: Displays only the docuemnt pages.
Outline: Display the table-of-contents outline as well as the document pages.
Full-screen: Displays pages on the whole screen; this mode is used primarily for presentations.
Controls the initial layout of document pages on the screen.
Single: Displays a single page at a time.
One column: Displays a single column of pages at a time.
Two column left/right: Display two columns of pages at a time; the first page is displayed in the left or right column as selected.
Choose the initial page that will be shown.

Security

Check to number all of the headings in the document.
 Versione stampabile   Modify
 Copy   Annotate
Specifies the document permissions.
Specifies the user password to restrict viewing permissions on this PDF document. Empty for no encryption.
Specifies the owner password to control who can change document permissions etc. If this field is left blank, a random 32-character password is generated so that no one can change the document.

Expert

Specify language to use for date and time format.
Shrink code blocks on page.
Show line numbers for code blocks.
Make spaces visable by dots (·) instead of white spaces.
Make line breaks visable by a extra character (¶) at the end.
Enable this feature if you searching for problems or intent to report a bug report

About

Version 2.4.2 (MoinMoin 1.9.7)


MoinMoin - Generate PDF document using HTMLDOC

This action script generate PDF documents from a Wiki site using
the HTMLDOC (http://www.htmldoc.org) software packages which has
to be preinstalled first.

Copy this script in your's MoinMoin action script plugin directory.

Thanks goes to Pascal Bauermeister who initiated the implementaion.
Lot of things changes since then but the idear using HTMLDOC is the
main concept of this implementation.

Please visit the homepage for further informations:
http://moinmo.in/ActionMarket/PdfAction

@copyright: (C) 2006 Pascal Bauermeister
@copyright: (C) 2006-2010 Raphael Bossek <raphael.bossek@solutions4linux.de>
@license: GNU GPL, see COPYING for details

       

Italiano English
Locked History Actions

HelpOnInstalling/ApacheOnLinuxFtp

HelpContents > HelpOnAdministration > HelpOnInstalling

Installing MoinMoin with Apache using ftp

This document describes how to install MoinMoin on the webserver of your ISP.

  • /!\ Please be warned that installing just by FTP (and not having shell access) is the least comfortable and most work intensive method to do it. If you need to change a file, you will have to ftp it back and forth. If you need to change many files (like your complete data_dir like when having to run some migration script) you will have to ftp many files back and forth. So if you like to have it comfortable, better get some server with shell access.

We will assume a few things:

  • Your ISP supports Python (with the right version) via CGI.
  • You have no telnet/ssh-access to the webserver, but ftp access.
  • You are not allowed to write into Python's site-packages directory.

  • You are not allowed to access apache's main config file.

Follow these steps:

Download the latest distribution of MoinMoin

Download the latest distribution of MoinMoin from MoinMoinDownload. Unpack it into a local directory. We do not need to run the setup.py script, we just work with the source code!

Explore the webserver configuration

Now it is time to find out how your ISP supports Python. If they support Python at all, they probably support the Common Gateway Interface (CGI). As noted above, I describe only this installation option. Now there is some homework for you to do:

  • Find out where the Python binary resides on your webserver. You should be able to find some hints in the ISPs online documentation, or you can ask their support team, or you can guess. Common locations are /usr/bin/python, /usr/bin/pythonX.X (X.X means the version number of Python like 2.3, 2.4 or newer) or /usr/local/bin/python. Sometimes, an ISP chooses to support more than one Python version, usually indicated by a version number in the search path. If possible, choose the latest version. Modify the first line of the explore script and the moin.cgi file to match the path of the python executable.

  • Try to find a place where Python scripts can be executed. To help you with that task, I have written a small script. Upload it to your webserver and see whether it gets executed or not. Here are some hints:
    • Use your favorite FTP-client and transfer your script to your webserver's cgi-bin directory, using the .cgi file extension. Try to call its URL via a web browser. If you don't have a cgi-bin,

    • copy the script into your favorite directory on your webserver, using the .py or .cgi file extension. Try to call its URL via a web browser.

    • First check it using the .cgi extension, then try the .py extension if necessary.

   1 #!/usr/bin/python
   2 
   3 import os.path
   4 import os
   5 import sys
   6 
   7 try:
   8     __file__
   9 except NameError:
  10     __file__ = '?'
  11 
  12 print """Content-type: text/html
  13 
  14 <html>
  15 <head>
  16  <title>Python Exploration</title>
  17 </head>
  18 <body>
  19  <table border=1>
  20  <tr><th colspan=2>1. System Information</th></tr>
  21  <tr><td>Python</td><td>%s</td></tr>
  22  <tr><td>Platform</td><td>%s</td></tr>
  23  <tr><td>Absolute path of this script</td><td>%s</td></tr>
  24  <tr><td>Filename</td><td>%s</td></tr>
  25 """ % (sys.version,
  26        sys.platform,
  27        os.path.abspath('.'),
  28        __file__)
  29 print "<th colspan=2>2. Environment Variables</th>"
  30 for variable in os.environ:
  31     print "<tr><td>%s</td><td>%s</td></tr>\n" % (variable, os.environ[variable])
  32 print """
  33 </table>
  34 </body>
  35 </html>
  36 """

Download: explore.py

Some of the following problems may show up:

  • If only the source code appears in your browser window, your file has not been processed by the CGI. Probably some kind of apache configuration is required to make things work. Consult your ISPs documentation.
  • If you encounter a 404 Not found error, that probably means what it says: you have chosen the wrong URL.

  • If you have errors in your script, apache usually reports an Internal Server Error.

  • If your script has wrong file privileges, apache may report a Premature End of Script Headers. Set the file permission so as to allow execution of the script. Your FTP-client will do the job.

If everything works, a table should appear on your screen. It gives you some basic information on your webserver. Later we will need Python version, absolute path of this script, DOCUMENT_ROOT and SITE_URI.

Copy directories

You have to transfer four directories in the moin directory to your webserver.

  • ./wiki/htdocs contains static files (e. g. css stylesheets and icons). Place this directory on your server somewhere under apache's DOCUMENT_ROOT and rename it to 'moin_static160'. Apache has to deliver them directly.

  • ./wiki/underlay contains wiki templates and help pages. Place this directory on your server outside the DOCUMENT_ROOT, if possible. Apache should not be able to deliver these files directly.

  • ./wiki/data is going to contain your wiki pages. Place this outside apache's DOCUMENT_ROOT.

  • ./MoinMoin contains python source code. Place this outside apache's DOCUMENT_ROOT.

SECURITY WARNING: If you have no choice but to place MoinMoin, underlay or data under apache's DOCUMENT_ROOT, it is very important to hinder apache from directly accessing them.

1. Use your favorite editor to create a file named .htaccess.

2. Insert into this file the text deny from all

3. Copy it via FTP into the directory you want to protect.

4. Try to access the protected directory via your webbrowser. If protection does work, you should see Access denied.

5. If you cannot protect these directories, please delete them from your webserver immediately. Do not continue your installation.

Configure

There are two files that need fine tuning:

  • ./wiki/server/moin.cgi is going to be called by apache whenever a wiki page is requested.

  • ./wiki/config/wikiconfig.py contains configuration options for your wiki.

Choose a location for these files on your webserver. You are free to choose, but apache must be able to execute moin.cgi. If necessary, you can even rename moin.cgi, for example to moin.py. I would recommend placing wikiconfig.py in a separate config directory that is not accessible by apache. Do not start uploading, we are going to make some modifications first.#

  • /!\ If you want to host more than one Wiki you need to work with farmconfig.py !

moin.cgi

Now open ./wiki/server/moin.cgi in your favorite editor.

(1) Adjust python path. First you have to adjust your python path in line 1. The new value depends on your ISPs setup.

(2) Set the path to MoinMoin. You will find a line

## sys.path.insert(0, 'PREFIX/lib/pythonX.X/site-packages')

Uncomment this line and replace the path information. If you have run explore.py on your webserver, you may use your knowledge of absolute path of this script to guess the absolute path to the MoinMoin directory.

Example: You transfered explore.py with your FTP-client into /public_html on your webserver. Absolute path of this script reveals /home/nowhere.com/public_html. You transfered MoinMoin to /MoinMoin. You plan to place moin.cgi as /pubic_html/index.py on your webserver. You would have to insert

sys.path.insert(0, '/home/nowhere.com')   # REPLACED!

Of course a relative path will be allright, too. So, sticking to our example, you could also insert

sys.path.insert(0, '..')

(3) Set the path to wikiconfig.py. Now search for

sys.path.insert(0, '/path/to/wikiconfig')

Insert the path to wikiconfig.py on your webserver.

Example: You transfered explore.py with your FTP-client into /public_html on your webserver. Absolute path of this script reveals /home/nowhere.com/public_html. Your planned location for wikiconfig.py is /config. You plan to place moin.cgi as /pubic_html/index.py on your webserver. You would have to insert

# choose one:
sys.path.insert(0, '/home/nowhere.com/config')           # absolute path
sys.path.insert(0, '../config')                          # path relative to moin.cgi

wikiconfig.py

Open ./wiki/config/wikiconfig.py.

(1) Set the path to your data directory. Try to find

data_dir = './data/'

Replace './data/' with whatever leads to your data directory.

Example: You transfered explore.py with your FTP-client into /public_html on your webserver. Absolute path of this script reveals /home/nowhere.com/public_html. You transfered data to /data. You plan to place moin.cgi as /pubic_html/index.py on your webserver. You would have to insert

# choose one:
data_dir = '/home/nowhere.com/data/'   # absolute path
data_dir = '../data/'                  # path relative to moin.cgi

(2) Set the path to your underlay directory. Try to find

data_underlay_dir = './underlay/'

Replace './underlay/' with whatever leads to the underlay directory on your webserver.

Example: You transfered explore.py with your FTP-client into /public_html on your webserver. Absolute path of this script reveals /home/nowhere.com/public_html. You transfered underlay to /underlay. You plan to place moin.cgi as /pubic_html/index.py on your webserver. You would have to insert

# choose one:
data_underlay_dir = '/home/nowhere.com/data/'   # absolute path
data_underlay_dir = '../data/'                  # path relative to moin.cgi

(3) Set the URL of your static files.

Static files like images and css files are served by Apache, not by moin. You install them in a location accessible by Apache, and tell moin what is the url of those files.

url_prefix = '/moin_static160' # depends on moin version

If you copied your htdocs directory to /moin_static160 under your document root, you don't need to change this.

  • (!) Important: url_prefix_static must start with a slash

Example: You placed explore.py under /public_html and called it with http://www.your-domain.com/explore.py. You placed htdocs as /public_html/wiki. So url_prefix is correct as it is, don't change it.

(4) Set configuration options. If you browse through wikiconfig.py, you will see a bunch of options. Set these options as you like. See HelpOnConfiguration for details.

Upload moin.cgi and wikiconfig.py

You are done! Upload moin.cgi and wikiconfig.py and test your wiki by calling moin.cgi through your webbrowser. You may have to set file permissions manually to allow the execution of moin.cgi. Be sure to upload both files to the directories described above.

Summary

Here is a short summary of an example installation. Having read this document, I hope you see what I did and why I did it.

ftp       ./wiki/data       ==>           /data
ftp       ./wiki/htdocs     ==>           /moin_static160
ftp       ./wiki/underlay   ==>           /underlay
ftp       ./MoinMoin        ==>           /MoinMoin

ftp       create directory     /config

create     ./.htaccess      insert content:
deny from all

ftp       ./.htaccess      ==>           /data
ftp       ./.htaccess      ==>           /underlay
ftp       ./.htaccess      ==>           /MoinMoin
ftp       ./.htaccess      ==>           /config

edit ./wiki/server/moin.cgi:

  replace:
           #!/usr/bin/env python
    by:
           #!/usr/bin/pythonX.X

  replace:
           ## sys.path.insert(0, 'PREFIX/lib/pythonX.X/site-packages')
    by:
           sys.path.insert(0, '.')

  replace:
           sys.path.insert(0, '/path/to/wikiconfig')
    by:
           sys.path.insert(0, './config')

ftp      ./wiki/server/moin.cgi   ==>     /moin.py
    
edit ./wiki/config/wikiconfig.py:

   set data_dir:
                   data_dir = './data/'

   set data_underlay_dir:
                   data_underlay_dir = './underlay/'

   set url_prefix:
                   url_prefix = '/moin_static160'

ftp      ./wiki/config/wikiconfig.py   ==>    /config/wikiconfig.py

If your provider's python is stoneage ...

  • find out what Python version the server runs
  • find another server that runs the same Python version and there:
  • after that, you have a nice, fresh python in $PREFIX
  • you can ftp it to your home directory at provider and use it from there