Primitive single-script (JavaScript
) to annotate name into SVG image.
This can usually be helpful to annotate documents like certificates, name cards, invitation cards, etc.
- inkscape
- git
- cURL - pre-installed on Windows and MacOS; Linux environment could either install curl (
sudo apt install -y curl
) or use the pre-installed wget as alternative - yarn (
npm install --global yarn
)
Annotate SVG
image formats with the names from user input argument or text file (for multiple names to different SVG
files), based on the given SVG
template.
Script Arguments:
name
(optional): Intended name for annotation, can be a name or a file, defaults to check ifnames.txt
exists for list of names if none was provided.template
(optional):SVG
template to be annotated, defaults to check iftemplate.svg
exists to be annotated.font
(optional): Font style, as long they are recognized byinkscape
.
Check out sample/names.txt and sample/template.svg.
- Start with either of the following, then
cd
into the directory.- git clone
git clone [email protected]:jonnysoe/svg-annotator.git && cd svg-annotator
- download the single svg-annotator.js script into a temp directory
mkdir svg-annotator && cd svg-annotator && curl -L -o svg-annotator.js https://raw.githubusercontent.com/jonnysoe/svg-annotator/main/svg-annotator.js
- git clone
- Prepare name list by the name
names.txt
(separated by new lines) in project root directory. - Prepare a template svg file by the name
template.svg
. - Run this command:
Alternatively, can run the following when package.json is present
node svg-annotator.js
node .
npm run start
NOTE: Single file svg-annotator.js will still generate package.json file.yarn run start
- Annotate a single
SVG
image with multiple names, might wanna changenames.txt
toCSV
format where names on the same row separated by comma will appear on the sameSVG
file
Copyright © 2023 Jonny Soe.
Licensed under the MIT License (MIT) or see LICENSE file for details.