export1Add my vote for this tag forms1Add my vote for this tag latex2Add my vote for this tag pdf2Add my vote for this tag create new tag
, view all tags


This plugin provides a mechanism to generate a pdf file out of an predefinied tex template. The user can create an own site the input all the information (e.g. name), which going to be transfered to the document or just let this plugin generate one. Anyway the following points are important to produce a fully functional pdf file

  • All templates have to be situated into the TWiki template directory.
  • you should insert these 2 packages \usepackage{amssymb,amsmath} , if you want to use all functionality


The following tex file:

\hspace*{-2mm}\begin{normalsize}\textbf{\underline{Internship Application}}\end{normalsize}\vspace{4mm}\\
NAME (last, first, middle):%NAME (max 30)#t%
\\CURRENT ADDRESS:%Current Address (max 80)#ta%
\\GENDER: \hspace*{5mm} %Gender#r:option=masculine,feminine:distance=5%
\\COUNTRY OF CITIZENSHIP:%Country of Citizenship#o:option=China, England, France, Germany, Japan, ...%
and the input InputForm.gif leads to


Syntax Rules

The user can use the GenApplication module to generate only the pdf output or provide the information for the automatic input form generation within the tex template.

Syntax to generate the pdf (only)

You have to specify a form and insert a button, which calls the method /bin/view/genapplication. Some parameters, which can be submitted via hidden fields are necessary as well. The complete form should look like this:
<form action="http://hugo/bin/genapplication/WEBNAME" method="post">

        ... Your Components ...

        <input type="hidden" name="allowedLettersName" value="\w|\s|\"|\.|,"/>
        <input type="hidden" name="allowedLettersOption" value="\w|#|:|=|\s|\"|,|\(|\)""/>
        <input type="hidden" name="template" value="TEMPLATENAME"/>
        <input type="hidden" name="favtopic" value="FAVCONTENTSTORETOPIC"/>
        <input type="Submit" value="Gentest"/></br></br>
The WEBNAME and FAVCONTENTSTORETOPIC should be defined as in the global settings below and the TEMPLATENAME should at least contains the username (e.g. RolfSabschContent).

To create a new field for the data, typed by the user you just have to insert

into the tex template. If no LENGTH is specified, the module take 50 letters to limit the input.

Syntax to generate an input form

If you wish to insert this plugin into a TWiki side, you have to add
The second one specifies a template, which is going to be extracted in this place. Otherwise a box occurs, which contains all the templates, defined below. After choosing one, the input gets extracted the same way as submitting (using an URL parameter) the template via the second method.

The next part deals with the syntax of the particular input components (textbox, textarea, combobox, checkbox and radiobutton). The common part of one component definition looks like

, where NAME specifies the naming of this component. The optional text between the brackets determines the amount of letters, which can be typed in. The string after the # symbol tells the system which input component should be used and the also optional ORDER determines its position within the generated input form. The OPTIONS could be any html attribute (e.g. size=10).

The following enumeration listed all available type and give some extra information on certain, non common OPTION definitions.

  • textbox: t
    • there is no special option value
    • %Name (max 30)#t1% leads to Name (max 30):
  • textarea: ta
    • there is no special option value
    • %Process Description (max 150)#ta% leads to Process Description:
  • combobox (optionbox), o
    • %Gender#o:option=masculine,feminine% leads to Gender:
    • the value after option specifies all the available entries in the combobox
  • checkbox c
    • there is no special option value
    • %Has car#c% leads to Has car:
    • when the checkbox gets created, a hidden field is generated to insert a empty box within the latex document, when this component is unchecked
  • radiobutton r
    • This component generated checked and empty boxes within the produced pdf file
    • %Has Childrens#r:option=yes,no:selectnr=1:distance=10% leads to Has Childrens: yesno
    • the value after option specifies all the available radiobox options
    • the optional value selectnr =1 specifies the element, which is checked on loading (zero indicates the first element)
    • and _distance_= 10 gets expanded to \hspace{10mm} to determine to distance between the boxes within the generated pdf file

Management of the favorites

This feature is available when this plugin generates the input form out of the tex file and a user is logged in. The form then includes a checkbox in front of every textbox and textarea. By pressing the generate button, all information, which belongs to a checked box gets stored into a site (customized by the global settings below).

To set up a newline you have use §n symbol.

An entry which contains one element looks like:

The NAME also contains all brackets and the specified limit of the according text component. When several values are stored the enumeration gets expanded to:
  • NAME
    • VALUE1
    • VALUE2

At the bottom of the site, which contains the favorites is also a restriction added, which limited the read and write access to the Administrator and the currently logged in user.

<!-- Only for the authorized people
   * Set ALLOWTOPIC CHANGE = Main.TWikiAdminGroup,  Main.RolfSabsch
   * Set ALLOWTOPIC VIEW = Main.TWikiAdminGroup,  Main.RolfSabsch

GenApplicationPlugin Global Settings

  • One line description, shown in the TextFormattingRules topic:
    • Set SHORTDESCRIPTION = Allows to generate a pdf Document out of a predefined tex file.

  • Used to restrict the used characters in the names of all variables :
    • Set ALLOWEDLETTERSINNAMES = \w|\s|\"|\.|,

  • Used to restrict the used characters in the options of all variables :
    • Set ALLOWEDLETTERSINOPTIONS= \w|#|:|=|\s|\"|,|\(|\)|\."

  • Specifies all available templates :
    • Set TEMPLATES= Urlaubsantrag, Internship, test

  • In which topic should all user data be stored (%u = user name, %a application name)
    • Set FAVTOPIC = %uContent

  • The header of the generated document (%a application name, %f location of the favorits)
    • Set HEADER = ---++ Form zur Eingabe der Daten für das %a Dokument\nIm Folgenden kann die Checkbox () dazu benutzt werden, die Eingaben zu den %f hinzuzufügen. Die volle Funktionalität steht dabei nur eingeloggten Benutzern zur Verfügung.\n \n

Plugin Installation Instructions

Note: You do not need to install anything on the browser to use this plugin. The following instructions are for the administrator who installs the plugin on the server where TWiki is running.

  • Download the ZIP file from the Plugin web (see below)
  • Unzip GenApplicationPlugin.zip in your twiki installation directory. Content:
    File: Description:
    data/TWiki/GenApplicationPlugin.txt Plugin topic
    bin/genapplication to redirect all information to the GenApplication.pm
    lib/TWiki/Contrib/GenApplication.pm Modul to generate the pdf
    lib/TWiki/Plugins/GenApplicationPlugin.pm Plugin Perl module
    * add the line $TWiki::cfg{Plugins}{GenApplicationPlugin}{Enabled} = 1; to the lib/LocalSite.cfg

Plugin Info

Plugin Author: TWiki:Main.RolfSabsch
Copyright: © 2006, TWiki:Main.RolfSabsch
License: GPL (GNU General Public License)
Plugin Version: 17 Dec 2006 (V1.000)
Change History:  
17 Dec 2006: Initial version
TWiki Dependency: $TWiki::Plugins::VERSION 1.1
CPAN Dependencies: none
Other Dependencies: pdfLatex
Perl Version: 5.8.6
Benchmarks: GoodStyle nn%, FormattedSearch nn%, GenApplicationPlugin nn%
Plugin Home: http://TWiki.org/cgi-bin/view/Plugins/GenApplicationPlugin
Feedback: http://TWiki.org/cgi-bin/view/Plugins/GenApplicationPluginDev
Appraisal: http://TWiki.org/cgi-bin/view/Plugins/GenApplicationPluginAppraisal

Related Topics: TWikiPlugins, DeveloperDocumentationCategory, AdminDocumentationCategory, TWikiPreferences

-- TWiki:Main.RolfSabsch - 17 Dec 2006

Edit | Attach | Watch | Print version | History: r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r4 - 2008-07-05 - OliverKrueger
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2016 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.