# Plugin: Data Merge Generator

**URL:** <https://krita-artists.org/t/plugin-data-merge-generator/84249>\
**Category:** Plugins and Scripts\
**Tags:** how-to\
**Created:** [February 10, 2024, 10:33pm UTC](https://krita-artists.org/t/plugin-data-merge-generator/84249 "2024-02-10T22:33:05Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![L.Sumireneko.M](https://krita-artists.org/letter_avatar_proxy/v4/letter/l/e19adc/32.png) [@L.Sumireneko.M](https://krita-artists.org/u/L.Sumireneko.M)\
**Post date:** [February 10, 2024, 10:33pm UTC](https://krita-artists.org/t/plugin-data-merge-generator/84249/1 "2024-02-10T22:33:06Z")

</div>

I was studying Python and Krita Plugin from last year’s Winter Holiday.  
So I made an **experimental** plug -in that would be a little convenient.

This plugin can also arrange many FileLayers. Currently, import and editing speeds on Krita are slow. This will probably be resolved when Krita becomes faster in the future.

* * *

The plugin

> **[GitHub - Sumireneko/data\_merge\_generator: This plugin runs a simple DataMerge on Krita....](https://github.com/Sumireneko/data_merge_generator)**
>
> This plugin runs a simple DataMerge on Krita. Requires template and data files. Experimental plugin.

And Sample Data (It contains csv file,kra file ,images, dummy images)

> **[GitHub - Sumireneko/data\_merge\_samples](https://github.com/Sumireneko/data_merge_samples)**
>
> Contribute to Sumireneko/data\_merge\_samples development by creating an account on GitHub.

* * *

Document

# Data Merge Generator Plugin for Krita

This plugin working simple version of Data Merge.  
Require Krita v5.2.2 later

### What is Data Merge?

Arrange them in order according to the contents of the database (csv) based on the prepared template krita file. For example, it can be useful for printing number tags, equipment tags, and employee business cards.

There are exist many systems for example ,Adobe InDesign’s feature,LibreOffice MailMerge,[Scribus Generator](https://berteh.github.io/ScribusGenerator/) ,[Inkscape NextGenerator](https://gitlab.com/Moini/nextgenerator)  
Also,this plugin inspired from the script “[Improved version of Data Join](http://indesigner.blog101.fc2.com/blog-entry-230.html)” for Adobe Illustrator.Thank you very much.

### Note and Disclaimer

- This plugin is experimental. It is not suitable for large amounts of data.
- Please try it with a small amount of data first.
- It is slow as the number of items and pixel resolution increases.
- Loading and editing kra file with many linked images will be slowly.  
So,it can also specify the max number of units to be placed per each export image file.
- Layer styles in template files are not supported.

##How to install a python plugin to krita

1. Run Krita application,
2. From `Menu → Setting → Manage Resources`
3. Click `Open Resource Folder` Button
4. Find `pykrita` folder (Explorer or Finder)
5. Copy `data_merge_gen`folder and `data_merge_gen.desktop` into `pykrita`
6. ReLunch Krita,and open `Preferences dialog → Select Python Plugin Manager` list.
7. For enable this plugin,find and click the Checkbox of `Data Maneger Generator`(This plugin) from the plugin list.

Note:  
In Step7,Select plugin name in the list,you can read built-in Manual.  
Also error message indicate with mouse hover tool-tip on the list when this plug-in load failed.

See also [this article](https://docs.krita.org/en/user_manual/python_scripting/install_custom_python_plugin.html) in Krita wiki.

### Uninstall

- Remove `data_merge_gen`folder and `data_merge_gen.desktop` from `pykrita` folder

## How to work this plug-in

- Users need to prepare customized kra and csv files.

### Preparation

1. Create a CSV file (.csv,.txt) The 1st line define for Tag keyword list,charactor code:UTF-8) and list…
2. Create a Krita’s image file (.kra) - Need one `GroupLayer` that named `Template`,Some `FileLayers` that named%%Tag%%,and `VectorLayer` that for replace `\<\<Tag\>\>s embed in text object)

### Run

1. Open the Template .kra file
2. Run on Krita (from `Tools → Scripts →Data Merge...`)
3. Setting (Optional)
4. Select the CSV file

### Update

- 2024 / 02 / 17 v1.6 Add Editable and Moveable aligorithm ,GroupLayer renamer

---

<div class="post-metadata">

**Author:** ![L.Sumireneko.M](https://krita-artists.org/letter_avatar_proxy/v4/letter/l/e19adc/32.png) [@L.Sumireneko.M](https://krita-artists.org/u/L.Sumireneko.M)\
**Post date:** [February 10, 2024, 10:56pm UTC](https://krita-artists.org/t/plugin-data-merge-generator/84249/2 "2024-02-10T22:56:51Z")

</div>

Example result  
 ![simple_](https://krita-artists.org/uploads/default/original/3X/8/3/83e9afcf00678169f34c1a5f5141baa4d795bc8b.png)

 ![layers](https://krita-artists.org/uploads/default/original/3X/a/1/a1c421e2b3cb3a81b5a02f8a9b8e16f75f99530c.png)  
 ![csvdata](https://krita-artists.org/uploads/default/original/3X/5/b/5ba75a5b1f3a1ee61162bf5772ae35b8bc193b91.png)  
 ![export_result](https://krita-artists.org/uploads/default/original/3X/c/8/c8e9a150212be2b2cabc331b103eeeb485c2c286.png)

![bcard](https://krita-artists.org/uploads/default/original/3X/9/9/99ab5cce8cd4b20a2781c7eb167cf46ab7fd808b.png)

 ![スクリーンショット 2024-02-11 7.43.29](https://krita-artists.org/uploads/default/original/3X/7/a/7a035a384c3aa90f872174e1f171ef8c3292a001.png)  
 ![sample_img1](https://krita-artists.org/uploads/default/original/3X/e/0/e0f75e7580957b72698c35c4cdf656c1f13305ae.png)

![post_card2](https://krita-artists.org/uploads/default/original/3X/d/7/d7f3339cdd5627ec771945b31cfb7fb94ea632ff.png)

 ![tcard](https://krita-artists.org/uploads/default/original/3X/8/9/89ec31b025d2cf82ee65cea95219a36084adf434.png)

---

<div class="post-metadata">

**Author:** ![sooz](https://krita-artists.org/user_avatar/krita-artists.org/sooz/32/93244_2.png) [@sooz](https://krita-artists.org/u/sooz)\
**Post date:** [February 10, 2024, 11:34pm UTC](https://krita-artists.org/t/plugin-data-merge-generator/84249/3 "2024-02-10T23:34:53Z")

</div>

Thank you for sharing the plugin with us.

---

<div class="post-metadata">

**Author:** ![EyeOdin](https://krita-artists.org/user_avatar/krita-artists.org/eyeodin/32/2662_2.png) [@EyeOdin](https://krita-artists.org/u/EyeOdin)\
**Post date:** [February 11, 2024, 3:07pm UTC](https://krita-artists.org/t/plugin-data-merge-generator/84249/4 "2024-02-11T15:07:35Z")

</div>

Looks very useful

---

<div class="post-metadata">

**Author:** ![L.Sumireneko.M](https://krita-artists.org/letter_avatar_proxy/v4/letter/l/e19adc/32.png) [@L.Sumireneko.M](https://krita-artists.org/u/L.Sumireneko.M)\
**Post date:** [February 17, 2024, 6:56am UTC](https://krita-artists.org/t/plugin-data-merge-generator/84249/5 "2024-02-17T06:56:44Z")

</div>

Thanks for reply 🙂
