19#ifdef CAIRO_HAS_PS_SURFACE
66 bool filtertobitmap,
int resolution,
bool eps =
false)
85 root->invoke_show(drawing, dkey, SP_ITEM_SHOW_DISPLAY);
108 root->invoke_hide(dkey);
129 int level = CAIRO_PS_LEVEL_2;
131 const gchar *new_level = mod->get_param_optiongroup(
"PSlevel");
132 if((new_level !=
nullptr) && (g_ascii_strcasecmp(
"PS3", new_level) == 0)) {
133 level = CAIRO_PS_LEVEL_3;
137 bool new_textToPath = FALSE;
139 new_textToPath = (strcmp(mod->get_param_optiongroup(
"textToPath"),
"paths") == 0);
142 bool new_textToLaTeX = FALSE;
144 new_textToLaTeX = (strcmp(mod->get_param_optiongroup(
"textToPath"),
"LaTeX") == 0);
147 g_warning(
"Parameter <textToLaTeX> might not exist");
150 bool new_blurToBitmap = FALSE;
152 new_blurToBitmap = mod->get_param_bool(
"blurToBitmap");
155 int new_bitmapResolution = 72;
157 new_bitmapResolution = mod->get_param_int(
"resolution");
163 final_name = g_strdup_printf(
"> %s", filename);
165 new_textToLaTeX, new_blurToBitmap,
166 new_bitmapResolution);
174 if (new_textToLaTeX) {
199 int level = CAIRO_PS_LEVEL_2;
201 const gchar *new_level = mod->get_param_optiongroup(
"PSlevel");
202 if((new_level !=
nullptr) && (g_ascii_strcasecmp(
"PS3", new_level) == 0)) {
203 level = CAIRO_PS_LEVEL_3;
207 bool new_textToPath = FALSE;
209 new_textToPath = (strcmp(mod->get_param_optiongroup(
"textToPath"),
"paths") == 0);
212 bool new_textToLaTeX = FALSE;
214 new_textToLaTeX = (strcmp(mod->get_param_optiongroup(
"textToPath"),
"LaTeX") == 0);
217 g_warning(
"Parameter <textToLaTeX> might not exist");
220 bool new_blurToBitmap = FALSE;
222 new_blurToBitmap = mod->get_param_bool(
"blurToBitmap");
225 int new_bitmapResolution = 72;
227 new_bitmapResolution = mod->get_param_int(
"resolution");
233 final_name = g_strdup_printf(
"> %s", filename);
235 new_textToLaTeX, new_blurToBitmap,
236 new_bitmapResolution,
true);
244 if (new_textToLaTeX) {
279 "<inkscape-extension xmlns=\"" INKSCAPE_EXTENSION_URI
"\">\n"
280 "<name>" N_(
"PostScript")
"</name>\n"
281 "<id>" SP_MODULE_KEY_PRINT_CAIRO_PS
"</id>\n"
282 "<param name=\"PSlevel\" gui-text=\"" N_(
"Restrict to PS level:")
"\" type=\"optiongroup\" appearance=\"combo\" >\n"
283 "<option value='PS3'>" N_(
"PostScript level 3")
"</option>\n"
284 "<option value='PS2'>" N_(
"PostScript level 2")
"</option>\n"
286 "<param name=\"textToPath\" gui-text=\"" N_(
"Text output options:")
"\" type=\"optiongroup\" appearance=\"radio\">\n"
287 "<option value=\"embed\">" N_(
"Embed fonts")
"</option>\n"
288 "<option value=\"paths\">" N_(
"Convert text to paths")
"</option>\n"
289 "<option value=\"LaTeX\">" N_(
"Omit text in PDF and create LaTeX file")
"</option>\n"
291 "<param name=\"blurToBitmap\" gui-text=\"" N_(
"Rasterize filter effects")
"\" type=\"bool\">true</param>\n"
292 "<param name=\"resolution\" gui-text=\"" N_(
"Resolution for rasterization (dpi):")
"\" type=\"int\" min=\"1\" max=\"10000\">96</param>\n"
294 "<hbox indent=\"1\"><image>info-outline</image><spacer/><vbox><spacer/>"
295 "<label>" N_(
"When exporting from the Export dialog, you can choose objects to export. 'Save a copy' / 'Save as' will export all pages.")
"</label>"
296 "<spacer size=\"5\" />"
297 "<label>" N_(
"The page bleed can be set with the Page tool.")
"</label>"
300 "<extension>.ps</extension>\n"
301 "<mimetype>image/x-postscript</mimetype>\n"
302 "<filetypename>" N_(
"PostScript (*.ps)")
"</filetypename>\n"
303 "<filetypetooltip>" N_(
"PostScript File")
"</filetypetooltip>\n"
305 "</inkscape-extension>", std::make_unique<CairoPsOutput>());
323 "<inkscape-extension xmlns=\"" INKSCAPE_EXTENSION_URI
"\">\n"
324 "<name>" N_(
"Encapsulated PostScript")
"</name>\n"
325 "<id>" SP_MODULE_KEY_PRINT_CAIRO_EPS
"</id>\n"
326 "<param name=\"PSlevel\" gui-text=\"" N_(
"Restrict to PS level:")
"\" type=\"optiongroup\" appearance=\"combo\" >\n"
327 "<option value='PS3'>" N_(
"PostScript level 3")
"</option>\n"
328 "<option value='PS2'>" N_(
"PostScript level 2")
"</option>\n"
330 "<param name=\"textToPath\" gui-text=\"" N_(
"Text output options:")
"\" type=\"optiongroup\" appearance=\"radio\">\n"
331 "<option value=\"embed\">" N_(
"Embed fonts")
"</option>\n"
332 "<option value=\"paths\">" N_(
"Convert text to paths")
"</option>\n"
333 "<option value=\"LaTeX\">" N_(
"Omit text in PDF and create LaTeX file")
"</option>\n"
335 "<param name=\"blurToBitmap\" gui-text=\"" N_(
"Rasterize filter effects")
"\" type=\"bool\">true</param>\n"
336 "<param name=\"resolution\" gui-text=\"" N_(
"Resolution for rasterization (dpi):")
"\" type=\"int\" min=\"1\" max=\"10000\">96</param>\n"
338 "<hbox indent=\"1\"><image>info-outline</image><spacer/><vbox><spacer/>"
339 "<label>" N_(
"When exporting from the Export dialog, you can choose objects to export. 'Save a copy' / 'Save as' will export all pages.")
"</label>"
340 "<spacer size=\"5\" />"
341 "<label>" N_(
"The page bleed can be set with the Page tool.")
"</label>"
344 "<extension>.eps</extension>\n"
345 "<mimetype>image/x-e-postscript</mimetype>\n"
346 "<filetypename>" N_(
"Encapsulated PostScript (*.eps)")
"</filetypename>\n"
347 "<filetypetooltip>" N_(
"Encapsulated PostScript File")
"</filetypetooltip>\n"
349 "</inkscape-extension>", std::make_unique<CairoEpsOutput>());
Declaration of CairoRenderContext, a class used for rendering with Cairo.
Declaration of CairoRenderer, a class used for rendering via a CairoRenderContext.
Extension * get(const gchar *key) const
This function looks up a Inkscape::Extension::Extension by using its unique id. It then returns a ref...
The object that is the basis for the Extension system.
bool get_param_bool(char const *name) const
Gets a parameter identified by name with the bool placed in value.
bool check(Inkscape::Extension::Extension *module) override
Verify any dependencies.
static void init()
A function allocate a copy of this function.
bool textToPath(Inkscape::Extension::Print *ext) override
Tell the printing engine whether text should be text or path.
void save(Inkscape::Extension::Output *mod, SPDocument *doc, gchar const *uri) override
This function calls the output module with the filename.
bool check(Inkscape::Extension::Extension *module) override
Verify any dependencies.
static void init()
A function allocate a copy of this function.
bool textToPath(Inkscape::Extension::Print *ext) override
Tell the printing engine whether text should be text or path.
void save(Inkscape::Extension::Output *mod, SPDocument *doc, gchar const *filename) override
This function calls the output module with the filename.
bool setPsTarget(gchar const *utf8_fn)
void setPSLevel(unsigned int level)
void setFilterToBitmap(bool filtertobitmap)
void setOmitText(bool omittext)
void setTextToPath(bool texttopath)
bool finish(bool finish_surface=true)
void setBitmapResolution(unsigned resolution)
bool renderPages(CairoRenderContext *ctx, SPDocument *doc, bool stretch_to_fit)
Handle multiple pages, pushing each out to cairo as needed using renderItem()
CairoRenderContext createContext()
bool setupDocument(CairoRenderContext *ctx, SPDocument *doc, SPItem const *base=nullptr)
Initializes the CairoRenderContext according to the specified SPDocument.
Generic failure for an undescribed reason.
Typed SVG document implementation.
SPRoot * getRoot()
Returns our SPRoot.
int ensureUpToDate(unsigned int object_modified_tag=0)
Repeatedly works on getting the document updated, since sometimes it takes more than one pass to get ...
static unsigned int display_key_new(unsigned numkeys)
Allocates unique integer keys.
A way to clear the N_ macro, which is defined as an inline function.
Declaration of LaTeXTextRenderer, used for rendering the accompanying LaTeX file when exporting to PD...
bool latex_render_document_text_to_file(SPDocument *doc, gchar const *filename, bool pdflatex)
This method is called by the PDF, EPS and PS output extensions.
static bool ps_print_document_to_file(SPDocument *doc, gchar const *filename, unsigned int level, bool texttopath, bool omittext, bool filtertobitmap, int resolution, bool eps=false)
DB db
This is the actual database object.
void build_from_mem(gchar const *buffer, std::unique_ptr< Implementation::Implementation > in_imp)
Create a module from a buffer holding an XML description.
Helper class to stream background task notifications as a series of messages.
void convert_text_to_curves(SPDocument *)
Convert all text in the document to path, in-place.
Some things pertinent to all visible shapes: SPItem, SPItemView, SPItemCtx.
SPRoot: SVG <svg> implementation.