/*
* A quick hack to use the Cairo renderer to write out a file. This
* then makes 'save as...' PS.
*
* Authors:
* Ted Gould <ted@gould.cx>
* Ulf Erikson <ulferikson@users.sf.net>
* Adib Taraben <theAdib@gmail.com>
* Jon A. Cruz <jon@joncruz.org>
* Abhishek Sharma
*
* Copyright (C) 2004-2006 Authors
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#ifdef HAVE_CAIRO_PDF
#include "cairo-ps.h"
#include "cairo-ps-out.h"
#include "cairo-render-context.h"
#include "cairo-renderer.h"
#include "latex-text-renderer.h"
#include <print.h>
#include "display/canvas-bpath.h"
#include "sp-item.h"
#include "style.h"
#include "sp-root.h"
#include "sp-shape.h"
#include "document.h"
namespace Inkscape {
namespace Extension {
namespace Internal {
{
return FALSE;
} else {
return TRUE;
}
}
{
return FALSE;
} else {
return TRUE;
}
}
static bool
ps_print_document_to_file(SPDocument *doc, gchar const *filename, unsigned int level, bool texttopath, bool omittext,
bool filtertobitmap, int resolution, const gchar * const exportId, bool exportDrawing, bool exportCanvas, float bleedmargin_px, bool eps = false)
{
doc->ensureUpToDate();
// we want to export the given item only
}
else {
// we want to export the entire document from root
}
if (!base)
return false;
/* Create renderer and context */
if(ret) {
/* Render document */
if (ret) {
}
}
delete renderer;
return ret;
}
/**
\brief This function calls the output module with the filename
\param mod unused
\param doc Document to be saved
\param filename Filename to save to (probably will end in .ps)
*/
void
{
unsigned int ret;
return;
try {
}
} catch(...) {}
try {
} catch(...) {}
try {
}
catch(...) {
g_warning("Parameter <textToLaTeX> might not exist");
}
try {
} catch(...) {}
try {
} catch(...) {}
bool new_areaPage = true;
try {
} catch(...) {}
float bleedmargin_px = 0.;
try {
} catch(...) {}
try {
} catch(...) {}
// Create PS
{
if (!ret)
}
// Create LaTeX file (if requested)
if (new_textToLaTeX) {
ret = latex_render_document_text_to_file(doc, filename, new_exportId, new_areaDrawing, new_areaPage, 0., false);
if (!ret)
}
}
/**
\brief This function calls the output module with the filename
\param mod unused
\param doc Document to be saved
\param filename Filename to save to (probably will end in .ps)
*/
void
{
unsigned int ret;
return;
try {
}
} catch(...) {}
try {
} catch(...) {}
try {
}
catch(...) {
g_warning("Parameter <textToLaTeX> might not exist");
}
try {
} catch(...) {}
try {
} catch(...) {}
bool new_areaPage = true;
try {
} catch(...) {}
float bleedmargin_px = 0.;
try {
} catch(...) {}
try {
} catch(...) {}
// Create EPS
{
bleedmargin_px, true);
if (!ret)
}
// Create LaTeX file (if requested)
if (new_textToLaTeX) {
ret = latex_render_document_text_to_file(doc, filename, new_exportId, new_areaDrawing, new_areaPage, 0., false);
if (!ret)
}
}
bool
{
}
bool
{
}
#include "clear-n_.h"
/**
\brief A function allocate a copy of this function.
This is the definition of Cairo PS out. This function just
calls the extension system with the memory allocated XML that
describes the data.
*/
void
{
"</param>\n"
"</param>\n"
"<param name=\"blurToBitmap\" gui-text=\"" N_("Rasterize filter effects") "\" type=\"boolean\">true</param>\n"
"<param name=\"resolution\" gui-text=\"" N_("Resolution for rasterization (dpi):") "\" type=\"int\" min=\"1\" max=\"10000\">96</param>\n"
"</param>"
"<param name=\"bleed\" gui-text=\"" N_("Bleed/margin (mm):") "\" type=\"float\" min=\"-10000\" max=\"10000\">0</param>\n"
"<param name=\"exportId\" gui-text=\"" N_("Limit export to the object with ID:") "\" type=\"string\"></param>\n"
"<output>\n"
"<extension>.ps</extension>\n"
"<mimetype>image/x-postscript</mimetype>\n"
"</output>\n"
"</inkscape-extension>", new CairoPsOutput());
return;
}
/**
\brief A function allocate a copy of this function.
This is the definition of Cairo EPS out. This function just
calls the extension system with the memory allocated XML that
describes the data.
*/
void
{
"</param>\n"
"</param>\n"
"<param name=\"blurToBitmap\" gui-text=\"" N_("Rasterize filter effects") "\" type=\"boolean\">true</param>\n"
"<param name=\"resolution\" gui-text=\"" N_("Resolution for rasterization (dpi):") "\" type=\"int\" min=\"1\" max=\"10000\">96</param>\n"
"</param>"
"<param name=\"bleed\" gui-text=\"" N_("Bleed/margin (mm)") "\" type=\"float\" min=\"-10000\" max=\"10000\">0</param>\n"
"<param name=\"exportId\" gui-text=\"" N_("Limit export to the object with ID:") "\" type=\"string\"></param>\n"
"<output>\n"
"<extension>.eps</extension>\n"
"<mimetype>image/x-e-postscript</mimetype>\n"
"</output>\n"
"</inkscape-extension>", new CairoEpsOutput());
return;
}
} } } /* namespace Inkscape, Extension, Implementation */
#endif /* HAVE_CAIRO_PDF */