summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 23d5bdf)
raw | patch | inline | side by side (parent: 23d5bdf)
author | Johan Engelen <goejendaagh@zonnet.nl> | |
Sat, 20 Feb 2010 21:01:12 +0000 (22:01 +0100) | ||
committer | Johan Engelen <goejendaagh@zonnet.nl> | |
Sat, 20 Feb 2010 21:01:12 +0000 (22:01 +0100) |
diff --git a/src/extension/internal/cairo-renderer-pdf-out.cpp b/src/extension/internal/cairo-renderer-pdf-out.cpp
index 0598c388adccaaa523c76bc8b4a6b64a0837ad82..a62d2cb14b3f853356c8768466149b7002925b5d 100644 (file)
static bool
pdf_render_document_to_file(SPDocument *doc, gchar const *filename, unsigned int level,
- bool texttopath, bool filtertobitmap, int resolution,
+ bool texttopath, bool texttolatex, bool filtertobitmap, int resolution,
const gchar * const exportId, bool exportDrawing, bool exportCanvas)
{
sp_document_ensure_up_to_date(doc);
CairoRenderContext *ctx = renderer->createContext();
ctx->setPDFLevel(level);
ctx->setTextToPath(texttopath);
+ renderer->_omitText = texttolatex;
ctx->setFilterToBitmap(filtertobitmap);
ctx->setBitmapResolution(resolution);
@@ -146,6 +147,14 @@ CairoRendererPdfOutput::save(Inkscape::Extension::Output *mod, SPDocument *doc,
g_warning("Parameter <textToPath> might not exist");
}
+ bool new_textToLaTeX = FALSE;
+ try {
+ new_textToLaTeX = mod->get_param_bool("textToLaTeX");
+ }
+ catch(...) {
+ g_warning("Parameter <textToLaTeX> might not exist");
+ }
+
bool new_blurToBitmap = FALSE;
try {
new_blurToBitmap = mod->get_param_bool("blurToBitmap");
gchar * final_name;
final_name = g_strdup_printf("> %s", filename);
ret = pdf_render_document_to_file(doc, final_name, level,
- new_textToPath, new_blurToBitmap, new_bitmapResolution,
+ new_textToPath, new_textToLaTeX, new_blurToBitmap, new_bitmapResolution,
new_exportId, new_exportDrawing, new_exportCanvas);
g_free(final_name);
"<_item value='PDF14'>" N_("PDF 1.4") "</_item>\n"
"</param>\n"
"<param name=\"textToPath\" gui-text=\"" N_("Convert texts to paths") "\" type=\"boolean\">false</param>\n"
+ "<param name=\"textToLaTeX\" gui-text=\"" N_("Exclude text, create LaTeX file") "\" type=\"boolean\">false</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\">90</param>\n"
"<param name=\"areaDrawing\" gui-text=\"" N_("Export area is drawing") "\" type=\"boolean\">false</param>\n"
index 0e68ae130a368c3013d97c0f56a2bf666f4d55de..6d75c1e5dc921d2a671a7425a64d01f145fb4a86 100644 (file)
namespace Internal {
CairoRenderer::CairoRenderer(void)
+ : _omitText(false)
{}
CairoRenderer::~CairoRenderer(void)
void
CairoRenderer::renderItem(CairoRenderContext *ctx, SPItem *item)
{
+ if ( _omitText && (SP_IS_TEXT(item) || SP_IS_FLOWTEXT(item)) ) {
+ // skip text if _omitText is true
+ return;
+ }
+
ctx->pushState();
setStateForItem(ctx, item);
index ab5d4cf58bf6bcc690d4af9b22a638626c4e94b0..d69a607532bace1993ab3514568f0b435b5f5b04 100644 (file)
/** Traverses the object tree and invokes the render methods. */
void renderItem(CairoRenderContext *ctx, SPItem *item);
+
+ /** If _omitText is true, no text will be output to the PDF document.
+ The PDF will be exactly the same as if the text was written to it and then erased. */
+ bool _omitText;
};
// FIXME: this should be a static method of CairoRenderer