Scribus Generator: Difference between revisions

From Scribus Wiki
Jump to navigation Jump to search
 
(11 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Scripting Index}}
{{Scripting Index}}


==What about Scribus Generator?==
==Mail-merge in Scribus: high quality PDFs from Excel / OpenOffice / CSV ==
Scribus comes with a broad set of page layout features and functionality. One feature missing is to replace text with data dynamically. This kind of feature you may already know as the typical mail merge functionality in your preferred office application.<br />
Scribus Generator fills this lack of functionality. Scribus Generator in general is an extension to replace text with data to automatic generated files (e.g. SLA, PDF).


==What about the Scribus file?==
[[File:ScribusGeneratorScreencast.png|thumbnail|short how-to video at https://www.youtube.com/watch/kMsRn38TOiQ]]
Create and Design your Scribus File as any other. At the positions where you need to replace text with data, just add '''%VAR_name%''' where '''name''' is the column name in the Data File. You can place the variable on any position within a text frame. Apply all format and style to the variable as it would be the concerning original text.


You can also use variables for images by simply using "%VAR_image%" as the image name. It won´t be displayed, but it will be printed. In the CSV file make sure to use the full path.
[http://www.scribus.net/ Scribus] comes with a broad set of page layout features and functionality. One feature missing is to replace text with data dynamically. This kind of feature is often known as the '''mail merge''' functionality in your favourite office application.  


==What about the Data File?==
[https://github.com/berteh/ScribusGenerator/ '''Scribus Generator'''] provides this functionality i. It allows you to:
The Scribus Generator expects a CSV file (Comma Separated Values), which is very simple to create. Open a spread sheet editor, enter the data and save/export as CSV. UTF-8 encoding is recommended. The columns have the same '''name''' as variables ('''%VAR_name%''') referenced in the Sribus file you have designed.
* replace texts dynamically
* replace images dynamically
* change colors, position, text font or size dynamically
* generate separate PDF (or Scribus) files for each data entry, or a single file from all your data
* work directly in Scribus with a nice user interface, or from the command line
* use any data source (Excel, OpenOffice, MySQL, Notepad, ...) that can export to CSV.
* and much more...


==What about the Settings?==
Generally speaking it replaces some of your text with (external) data, to automatically generate files (e.g. SLA, PDF). It has been originally written by [http://www.ekkehardwill.de/sg/ Ekkehard Will] and further extended by [https://github.com/berteh/ScribusGenerator/ Berteh].
There is a Dialog where you can configure the Input and Output Settings for Scribus Generator.
{|
|-
| ''Scribus File:'' || Choose the Scribus File containing the variables to replace.
|-
| ''Data File:'' || Choose the Data File containing the comma separated values.
|-
| ''Output Directory:'' || Choose the path to the existing directory where to save the result.
|-
| ''Output File Name:'' || You can use the same variables as defined in the Scribus File/Data File. You can also mix the variables with other characters.<br />If you leave the field empty an index will be used. The index/resulting files will be sorted according to the occurence of the rows within the Data File. Don't enter non variable name because script will create only one PDF with last record from CSV.
|-
| ''Output Format:'' || Choose the output format, e.g. PDF.
|-
| ''Keep Scribus File:'' || Choose whether to keep the generated Scribus Files. Otherwise they will be deleted after generation an only the files in the specified output format will be kept.
|}


==Download==
A [https://www.youtube.com/watch/kMsRn38TOiQ short '''how to video'''] introduces this Scribus Generator. 6 first minutes for the basic overview, 12 last for some more advanced features.
For further information and download of the current version, please visit:<br />
 
[http://www.ekkehardwill.de/sg/ Scribus Generator]
'''Scribus Generator''' can be started from the Menu «Scribus → Script → Execute Script» (choose ``ScribusGenerator.py``), or used from the [https://github.com/berteh/ScribusGenerator/#running-scribus-generator-from-the-command-line command line]. It is implemented as a Python script.
 
[https://github.com/berteh/ScribusGenerator/archive/master.zip Download] the script and uncompress it anywhere on your machine. It's ready to be used!
 
==Download and documentation ==
For further information and download of the current version, please visit [https://github.com/berteh/ScribusGenerator/ Scribus Generator] and search the [https://github.com/berteh/ScribusGenerator/issues?q=is%3Aissue+is%3Aclosed resolved issues]
 
Many settings are available, as you can see in the interface screenshot below. Find them all in the  [https://github.com/berteh/ScribusGenerator#run-the-generator-script---settings documentation].
 
[[File:ScribusGeneratorInterface.png|thumbnail|right|Scribus Generator Interface]]
 
==Acknowledgement==
The original Scribus Generator is still available online at: [http://www.ekkehardwill.de/sg/ www.ekkehardwill.de]
 
The new [https://github.com/berteh/ScribusGenerator/ Scribus Generator] integrates various improvements such as:
 
* merge the output in a single file
* support linked frames for continuous text flow
* run Scribus Generator from the command-line
* use custom CSV field delimiters  (thanks [http://wiki.scribus.net/canvas/User:MZaske Martin Zaske])
* generate only for a subset of your data, great for quickly testing your template (thanks Bjarne Svanberg)
* dynamically modify any element in Scribus (line width, shape colors, element position, size, rotation, text font, text size,...)
* and much more.
 
Feel free to join the effort or submit your requests on the [https://github.com/berteh/ScribusGenerator/issues issue tracker].

Latest revision as of 14:50, 14 September 2015

This article is part of the Scripts series.

Mail-merge in Scribus: high quality PDFs from Excel / OpenOffice / CSV

Scribus comes with a broad set of page layout features and functionality. One feature missing is to replace text with data dynamically. This kind of feature is often known as the mail merge functionality in your favourite office application.

Scribus Generator provides this functionality i. It allows you to:

  • replace texts dynamically
  • replace images dynamically
  • change colors, position, text font or size dynamically
  • generate separate PDF (or Scribus) files for each data entry, or a single file from all your data
  • work directly in Scribus with a nice user interface, or from the command line
  • use any data source (Excel, OpenOffice, MySQL, Notepad, ...) that can export to CSV.
  • and much more...

Generally speaking it replaces some of your text with (external) data, to automatically generate files (e.g. SLA, PDF). It has been originally written by Ekkehard Will and further extended by Berteh.

A short how to video introduces this Scribus Generator. 6 first minutes for the basic overview, 12 last for some more advanced features.

Scribus Generator can be started from the Menu «Scribus → Script → Execute Script» (choose ``ScribusGenerator.py``), or used from the command line. It is implemented as a Python script.

Download the script and uncompress it anywhere on your machine. It's ready to be used!

Download and documentation

For further information and download of the current version, please visit Scribus Generator and search the resolved issues

Many settings are available, as you can see in the interface screenshot below. Find them all in the documentation.

Scribus Generator Interface

Acknowledgement

The original Scribus Generator is still available online at: www.ekkehardwill.de

The new Scribus Generator integrates various improvements such as:

  • merge the output in a single file
  • support linked frames for continuous text flow
  • run Scribus Generator from the command-line
  • use custom CSV field delimiters (thanks Martin Zaske)
  • generate only for a subset of your data, great for quickly testing your template (thanks Bjarne Svanberg)
  • dynamically modify any element in Scribus (line width, shape colors, element position, size, rotation, text font, text size,...)
  • and much more.

Feel free to join the effort or submit your requests on the issue tracker.