Author Topic: Design Templates over Created Extension in to the New Design  (Read 444 times)

February 03, 2019, 04:19:26 AM
Read 444 times

kzorluoglu

  • Newbie

  • Offline
  • *

  • 1
Hello Everyone,
i making now a Extension for Inkscape, and i want "created Templates/SVG with Text" over myExtension importing in to my new design.

I can now normally jpeg/png import. Question is,  How can I pre-made SVG with Text Editing Option directly in to the my new design over my extension importing?

Actually Workflow:
New -> New Design -> Go Extension Menu under Filter -> Import Template -> Template for GROUP A

my extension.py (actually i import only png image)
Code: [Select]
................
            if logo == "groupA":
                 image = "data:image/png;base64,iVBORw0K......................................"

        attribs = {
            'height': str(200),
            'width': str(200),
            'x': str(pageWidth-logoWidth),
            'y': str(pageHeight-logoHeight),
            'preserveAspectRatio': 'None',
            inkex.addNS('href', 'xlink'): image
        }

        createdImage = inkex.etree.Element(inkex.addNS('image', 'svg'), attribs)
  • Windows 10 Pro

February 03, 2019, 06:46:48 AM
Reply #1

Moini

  • IC Mentor

  • Offline
  • ******

  • 1,568
    • VektorRascheln
Check out how the other procedural template extensions do it (those starting with 'empty' in their file names).
The seamless pattern extension from the inkscape.org website is another example.

https://gitlab.com/inkscape/inkscape/tree/0.92.x/share/extensions