2
* A quick hack to use the print output to write out a file. This
3
* then makes 'save as...' Postscript.
6
* Ted Gould <ted@gould.cx>
8
* Copyright (C) 2004 Authors
10
* Released under GNU GPL, read the file 'COPYING' for more information
18
#include "extension/system.h"
19
#include "extension/db.h"
20
#include "extension/output.h"
27
PsOutput::check( Inkscape::Extension::Extension * /*module*/ )
29
if (NULL == Inkscape::Extension::db.get(SP_MODULE_KEY_PRINT_PS))
36
\brief This function calls the print system with the filename
38
\param doc Document to be saved
39
\param uri Filename to save to (probably will end in .ps)
41
The most interesting thing that this function does is just attach
42
an '>' on the front of the filename. This is the syntax used to
43
tell the printing system to save to file.
46
PsOutput::save (Inkscape::Extension::Output *mod, SPDocument *doc, const gchar *uri)
48
Inkscape::Extension::Extension * ext;
50
ext = Inkscape::Extension::db.get(SP_MODULE_KEY_PRINT_PS);
54
bool old_textToPath = ext->get_param_bool("textToPath");
55
bool new_val = mod->get_param_bool("textToPath");
56
ext->set_param_bool("textToPath", new_val);
59
final_name = g_strdup_printf("> %s", uri);
60
sp_print_document_to_file(doc, final_name);
63
ext->set_param_bool("textToPath", old_textToPath);
71
\brief A function allocate a copy of this function.
73
This is the definition of postscript out. This function just
74
calls the extension system with the memory allocated XML that
80
Inkscape::Extension::build_from_mem(
81
"<inkscape-extension xmlns=\"" INKSCAPE_EXTENSION_URI "\">\n"
82
"<name>" N_("Postscript Output") "</name>\n"
83
"<id>org.inkscape.output.ps</id>\n"
84
"<param name=\"textToPath\" gui-text=\"" N_("Convert texts to paths") "\" type=\"boolean\">true</param>\n"
85
"<param name=\"fontEmbedded\" gui-text=\"" N_("Embed fonts (Type 1 only)") "\" type=\"boolean\">false</param>\n"
87
"<extension>.ps</extension>\n"
88
"<mimetype>image/x-postscript</mimetype>\n"
89
"<filetypename>" N_("PostScript (old exporter via print) (*.ps)") "</filetypename>\n"
90
"<filetypetooltip>" N_("PostScript File") "</filetypetooltip>\n"
92
"</inkscape-extension>", new PsOutput());
97
} } } /* namespace Inkscape, Extension, Implementation */