"no file" input

Discussion about writing code for Inkscape.
phasianus
Posts: 1
Joined: Tue Oct 18, 2011 12:00 am

"no file" input

Postby phasianus » Tue Oct 18, 2011 2:39 am

hi,
How can I do input svg data from database? I am not able to find any example in python. All input and output extensions work with files only. Is it possible to design other resource?
thanx
--pb--

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: "no file" input

Postby ~suv » Tue Oct 18, 2011 4:12 pm

phasianus wrote:All input and output extensions work with files only
The feature request Bug #171016 “Allow import/export via stdin/stdout” describes how inkscape can read from stdin and write to stdout on the command line, on unix- and linux-based systems:
Niko Kiirala on 2007-12-18 wrote:To some extent, this can already be done by using special files /dev/stdin, /dev/stdout and /dev/stderr. Inkscape does emit a warning that it cannot determine the type of such a file, and tries to open it as SVG file.

On Windows those files obviously don't exist, but with mighty luck, same could be done using special filename con. I wouldn't hold my breath, though.

Please read the other comments there for reported limitations…


phasianus wrote:How can I do input svg data from database?
Regular input/output extensions obviously are file-based, but one could imagine to write an 'effect' extension (which will be listed in the 'Extensions' menu), which inserts the extracted content of a database as group or new layer into the current (e.g. new/empty) document, or processes/parses the current document (e.g. based on attributes in a custom namespace) to store the extracted values into a database (done within the script).

Some questions on Launchpad (Integrating Inkscape with our CMS checkin, Scripting question - name of input file available) describe issues arising when trying to integrate Inkscape with a custom CMS (on Windows) - maybe some of the (by now dated) questions and comments are helpful to you as well.

Other links possibly of interest:

User avatar
LiquidAsh
Posts: 71
Joined: Fri Apr 22, 2011 11:35 pm
Contact:

Re: "no file" input

Postby LiquidAsh » Mon Nov 07, 2011 1:43 am

I should have a tutorial about using standalone executables as extensions. I should have it done tomorrow, and believe it would allow you to access your database with whatever language you are used to. I'm using C#, but the rest of the setup should work as well for other languages.


Return to “Programming”