PDF Editor (aka. ScribusUtils) is a tool that allows you to convert a pdf based
document (with some special field-implementation) into an ERP5 compliant Module.
Table of Contents
The main document can be based on a paper form (filled by hand) and The final
result is a Module in which you can add new objects by filling all the necessary
fields. The script allow two kind of filling forms in ERP5 :
Two files are needed to generate a conversion : .PDF & .SLA .
The SLA file has to be created as a final filling form under Scribus (as it is
a Scribus file). A background is accepted but other special graphic objects (such
as lines, circles, images, etc.) shoud be escaped in the final document.
The fields have to be created as 'PDF fields' and their type is chosen according
to the final expected rendering.
Each field needs a name (in the name property). Whitespaces and special characters
are not allowed as this name will be used as the object name in ERP5 (for example
'my_destination_last_name'). Beware the field's name must match
ERP5 naming conventions.
The TooltipField holds other properties such as title, order, nb, etc. (exhaustive
list and restrictions available further in this document) but you can also use
properties available from the Scribus interface to define what you wish (text,
integer, float, multiline, required, etc.).
Keep in mind priority is given to user-defined properties rather than scribus
properties (this means that if field type is integer under Scribus, but user
specified multiline text, the script will render a multiline field.
Once your document is finished, you save your .SLA document under the name of
your choice and export also the result as a .PDF file (used to generated the PDF
output under ERP5).
There it is, you now have all the files you need to generate a new module.
Thanks to these two documents, you can now run the script.
For that you have to use your favourites : 'Create Module From Scribus' (calls
the form 'createERP5Site_viewCreateModuleScribusDialog') and fill it with needed
values. The left side refers to the Module properties while the right side is
Once this is done, you just have to link your .SLA and .PDF documents and check
the kind of rendering you mant to generate and then click 'create'.
Depending on your documents'size and on your server connection the files can take
up to some minutes to upload.
If everything is going well, you should be redirected to ERP5 main page once the
module is generated.
Then you just have to select the new module in the module list available and
chose 'Add Object'.
If an error occurs, you can check the ERP5 logfile to have more informations
(the script tries to log as many usefull events as possible).
If no error is raised, a new object be created in the object list on the ERP main page.
Just click on it and then select from the Action list 'add MyObject'.
You should be redirected to the rendered output, PDF-like or ERP-like depending on your previous selections.
These softwares (only needed in Graphic rendering for background pictures generation) :
The following files:
The Input form and Script (in ERP5):
Here are listed all the field properties you can specify on your fields by setting
them in the tooltipfield.
The tooltipfield has to be considered as a dictionnary, with entry separator '#' and id/value separator ':'.
For example 'nb:020#title:Diagnostic#type:TextAreaField#order:Left'.
The properties order is not important and you can specify your properties the
way you want, the only restriction is that you need the property_name ('nb',
'type', etc.) separated from the property_value with a ':', and all properties
separated with a '#'.
Spaces and special caracters (except ':' and '#') are allowed in the properties_values.
The creation number is used to specify the order of the fields when rendering as
ERP5 basic form, and define the tabulation order in the PDF-like rendering.
Numbers are integer only, but missing numbers are allowed (you can have number
10 but no number 9 for example). All fields with no creation number will be
created at the end. The script automatically group field_numbers by page,
this means creation order is processed for the first page, then for the second,
etc. to preserve page integrity and prevent tab order to move from one page to
The field title is used as a user-friendly text instead of the field-name
(more abstract). It represents the main text in the ERP rendering (text on
the left-side of the field), and is displayed as a tooltiptext in graphic
output(when the user leaves the cursor over the field for a second).
This position order is only used for the ERP-based rendering to specify where
the field will be rendered, and is ignored in graphic view (order is automatically
recovered from the page_number). It can accept 'left' (default),'right', 'center'
This property allows the user to specify by itsef the field type without using
the Scribus Dialog boxes. It is needed for RelationStringField for example,
which have no equivalent in PDF-fields. compliant values are : 'StringField','TextAreaField','RelationStringField','DateTimeField','IntegerField','CheckBoxField'. Default type is StringField
Specify if the field is required or not, i.e if the user has to enter a valid
alue or if the field can stay empty. values : '0' (default) or '1'.
for these fields, the user can specify the maximum number of caracters allowed,
and when rendering as an ERP5 basic form the size of the field (to match exactly
the maximum number allowed). This value can possibly be specified with the Scribus
interface in the object's 'option' tab. It must be an integer-compliant (float
will be automatically converted to the closest integer).
This property is used to specify in which order the dates will have to be filled.
Allowed values are 'year/month/day' (default), 'day/month/year' and 'month/day/year'.
For more efficiency you can just enter the first letter of each name : 'ymd', 'dmy'
and 'mdy'. As the date format available under Scribus (through the Scribus
Interface 'date field format') does not match the ERP5 presentation, ScribusUtils
ignore them and only take care of the user specification in the tooltipfield.
The date_only property permit to restrict the usage of a DateTimeField to a
'DateField' by escaping the time rendering. values are : '1' (default) or '0'
This 'date_separator' property permit to define the separator between the
different field values. This separator is displayed when filling the form in
ERP5 rendering (the PDF-like rendering will only display the InputBoxes, without
any other character), but is also used to process the PDF output final rendering
(via the 'print' button). The value can be any String except ':' and '#' characters
(for the moment). Default value is ' '. This can be very usefull to fill PDF
fields wich have already '/' characters, or to expand date elements like
'2006 02 01' instead of '2006 02 01'. Note that if you want to have empty
spaces like ' ' or ' ', you have better no to insert the 'date_separator'
property at the end of the tooltip (as the parsing procedure can not get
the spaces at the end of the tooltipfield).
Works the same way as the 'date_separator' property, but specify the separation
between hours and minutes. default is ' ' and same note apply (do not leave this
property at the end of the tooltipfield if it contains spaces).
specify the portal_type related to the RelationStringField
specify the base_category to the RelationStringField
specify the catalog_index to the RelationStringField
specify the default_module to the RelationStringField
To make RadioField, it is necessary to create a String field in the scribus file.
And it is necessary to give the global proerty type in the tooltipfield. So for
this field, it's type:RadioField You must also specify other porperties:
the property items is a suite of item separated by '|'. This property is also
define in tooltiptooltipfield.
You have choice between two values: 'vertical' and 'horizontal'. If this property
is not specify the value is 'vertical'
It is possible to make a RadioField only when you choose ERP5Form render and not with graphic render
To make CheckBoxField, it is necessary to create a CheckBox field in the scribus
file. You can also specify globals porperties.