diff --git a/src/main.cpp b/src/main.cpp
index f96d99e11e29a8dcffd545131f6364b397ab4ad8..d11222203778b3728d0fec669d76494fae9bec3f 100644 (file)
--- a/src/main.cpp
+++ b/src/main.cpp
#include "gc-core.h"
+#ifdef AND
+#undef AND
+#endif
+
#include "macros.h"
#include "file.h"
#include "document.h"
#include <extension/input.h>
#ifdef WIN32
-//#define REPLACEARGS_ANSI
-//#define REPLACEARGS_DEBUG
-
#include "registrytool.h"
-
#include "extension/internal/win32.h"
using Inkscape::Extension::Internal::PrintWin32;
-
#endif // WIN32
#include "extension/init.h"
SP_ARG_EXPORT_PS,
SP_ARG_EXPORT_EPS,
SP_ARG_EXPORT_PDF,
+ SP_ARG_EXPORT_LATEX,
#ifdef WIN32
SP_ARG_EXPORT_EMF,
#endif //WIN32
static gchar *sp_export_area = NULL;
static gboolean sp_export_area_drawing = FALSE;
static gboolean sp_export_area_page = FALSE;
+static gboolean sp_export_latex = FALSE;
static gchar *sp_export_width = NULL;
static gchar *sp_export_height = NULL;
static gchar *sp_export_id = NULL;
sp_export_area = NULL;
sp_export_area_drawing = FALSE;
sp_export_area_page = FALSE;
+ sp_export_latex = FALSE;
sp_export_width = NULL;
sp_export_height = NULL;
sp_export_id = NULL;
N_("Export document to a PDF file"),
N_("FILENAME")},
+ {"export-latex", 0,
+ POPT_ARG_NONE, &sp_export_latex, SP_ARG_EXPORT_LATEX,
+ N_("Export PDF/PS/EPS without text. Besides the PDF/PS/EPS, a LaTeX file is exported, putting the text on top of the PDF/PS/EPS file. Include the result in LaTeX like: \\input{latexfile.tex}"),
+ NULL},
+
#ifdef WIN32
{"export-emf", 'M',
POPT_ARG_STRING, &sp_export_emf, SP_ARG_EXPORT_EMF,
// TODO these should use xxxW() calls explicitly and convert UTF-16 <--> UTF-8
SetCurrentDirectory(homedir.c_str());
_win32_set_inkscape_env(homedir);
- RegistryTool rt;
- rt.setPathInfo();
+ // Don't touch the registry (works fine without it) for Inkscape Portable
+ gchar const *val = g_getenv("INKSCAPE_PORTABLE_PROFILE_DIR");
+ if (!val) {
+ RegistryTool rt;
+ rt.setPathInfo();
+ }
#endif
// Prevents errors like "Unable to wrap GdkPixbuf..." (in nr-filter-image.cpp for example)
|| !strncmp(argv[i], "--export-eps", 12)
|| !strcmp(argv[i], "-A")
|| !strncmp(argv[i], "--export-pdf", 12)
+ || !strncmp(argv[i], "--export-latex", 14)
#ifdef WIN32
|| !strcmp(argv[i], "-M")
|| !strncmp(argv[i], "--export-emf", 12)
do_query_all_recurse (SPObject *o)
{
SPItem *item = ((SPItem *) o);
- if (o->id && SP_IS_ITEM(item)) {
+ if (o->getId() && SP_IS_ITEM(item)) {
Geom::OptRect area = item->getBounds(sp_item_i2doc_affine(item));
if (area) {
Inkscape::SVGOStringStream os;
- os << o->id;
+ os << o->getId();
os << "," << area->min()[Geom::X];
os << "," << area->min()[Geom::Y];
os << "," << area->dimensions()[Geom::X];
@@ -1514,6 +1526,12 @@ static void do_export_ps_pdf(SPDocument* doc, gchar const* uri, char const* mime
(*i)->set_param_bool("textToPath", FALSE);
}
+ if (sp_export_latex) {
+ (*i)->set_param_bool("textToLaTeX", TRUE);
+ } else {
+ (*i)->set_param_bool("textToLaTeX", FALSE);
+ }
+
if (sp_export_ignore_filters) {
(*i)->set_param_bool("blurToBitmap", FALSE);
} else {