Inkscape Community

Help Using Inkscape => Beyond the Basics => Topic started by: kzorluoglu on February 03, 2019, 04:19:26 AM

Title: Design Templates over Created Extension in to the New Design
Post by: kzorluoglu on February 03, 2019, 04:19:26 AM
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)
Title: Re: Design Templates over Created Extension in to the New Design
Post by: Moini on February 03, 2019, 06:46:48 AM
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