mightyscape-1.2/extensions/fablabchemnitz/nextgenerator/nextgenerator.inx

74 lines
6.3 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?xml version="1.0" encoding="UTF-8"?>
<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension">
<name>NextGenerator</name>
<id>fablabchemnitz.de.nextgenerator</id>
<param name="tab" type="notebook">
<page name="config" gui-text="Options">
<label appearance="header">Input options</label>
<param gui-text="CSV file:" gui-description="A file with comma-separated values, one line per exported file. The first line contains the column names. Put quotation marks around your variables if they contain a comma." name="csv_file" type="path" mode="file" filetypes="csv">/path/to/file.csv</param>
<spacer />
<label>Non-text values to replace (see Help tab):</label>
<param name="extra-vars" type="string" gui-text="&#8291;"></param>
<param gui-text="Number of sets in the template:" gui-description="How many datasets fit into one template file - e.g. if you have an A4 page with 8 visitor badges for 8 different persons which use the same variable names, choose '8'. See 'Help' tab for more info." name="num_sets" type="int" min="1" max="10000">1</param>
<spacer />
<separator />
<spacer />
<label appearance="header">Output options</label>
<param name="format" type="optiongroup" appearance="combo" gui-text="Export file format:">
<option value="png">PNG</option>
<option value="pdf">PDF</option>
<option value="svg">SVG</option>
<option value="ps">PS</option>
<option value="eps">EPS</option>
</param>
<param gui-text="DPI (for PNG and filters):" gui-description="The resolution for your exported raster images" name="dpi" type="int" min="1" max="10000">300</param>
<param gui-text="File name pattern:" gui-description="The pattern for the names of the generated files. If 'Number of sets' is 1, it should contain at least one unique column variable (in the form of '%VAR_my_variable_name%'), or a unique combination of column variables, so new files won't overwrite those that have already been generated. Do not include the file extension, it will be added automatically. If 'Number of sets' is greater than 1, use any name you like. The exported files will be numbered automatically." name="file_pattern" type="string">%VAR_my_variable_name%</param>
<param gui-text="Merge output PDF files into one PDF file" gui-description="When outputting to PDF format, merge the resulting files into a single, multi-page PDF file. Requires ghostscript (https://ghostscript.com) to be installed."
name="merge_pdf" type="bool">false</param>
<param gui-text="Save in:" gui-description="The name of the folder where the generated images should be saved" name="output_folder" type="path" mode="folders">/tmp</param>
<param gui-text="Limit to first output file" gui-description="This is for testing purpose only. Savely check the output before creating hundreds of files."
name="limit_output" type="bool">false</param>
</page>
<page name="help" gui-text="Help">
<param name="helptabs" type="notebook">
<page name="help1" gui-text="Replacing text">
<label xml:space="preserve">In your SVG file, create any texts that you want to replace by clicking (not clicking and dragging) on the canvas. If you want to limit the width of the text, use the diamond-shaped handle at the end of the first line to indicate a maximum width. The text will auto-flow into the next line if it is longer. Make sure there is enough space for your texts.
As (or into) the text, type '%VAR_my_variable_name%' (without the quotes) as a placeholder, where 'my_variable_name' is the title of the corresponding column in your CSV data file.</label>
</page>
<page name="help2" gui-text="Replacing attributes">
<label xml:space="preserve">If you want to replace attribute values in your SVG file (e.g. a color, or the name of a linked image file), you can assign them to columns in the field labeled "Non-text values to replace" in JSON format like this (no linebreaks allowed):
{"background_color":"#ff0000", "photo":"image.png"}
All objects that use the red color (#ff0000) will then be exported using the colors in the column 'background_color'. The linked image 'image.png' will be replaced by the image files listed in the column 'photo' (make sure to replace the complete image path).</label>
</page>
<page name="help3" gui-text="Multiple sets">
<label xml:space="preserve">If you intend to have multiple sets in a single template for example, multiple conference badges on a larger page that will later be cut make sure to group each set together.
Also make sure to use a variable only exactly once per set. If you do not adhere to this, your variables will get out of sync and your generated files will contain incorrect data.</label>
</page>
</param>
</page>
<page name="about" gui-text="About">
<label appearance="header">NextGenerator</label>
<label indent="1">Version 1.6</label>
<spacer />
<label xml:space="preserve">An Inkscape extension to automatically replace values (text, attribute values) in an SVG file and to then export the result to various file formats. This is useful e.g. for generating images for name badges and other similar items.
This extension is a Python rewrite of the Generator bash script extension by Aurélio A. Heckert. It is compatible with Inkscape starting from version 1.0 and requires Python 3.</label>
</page>
</param>
<effect needs-live-preview="false">
<object-type>all</object-type>
<menu-tip>Automatically replace values and export the result.</menu-tip>
<effects-menu>
<submenu name="FabLab Chemnitz">
<submenu name="Import/Export/Transfer" />
</submenu>
</effects-menu>
<menu-tip>Automatically replace values and export the result.</menu-tip>
</effect>
<script>
<command location="inx" interpreter="python">nextgenerator.py</command>
</script>
</inkscape-extension>