#ifdef G_OS_WIN32
ooo_path = g_strjoinv ("\\\\", g_strsplit (priv->ooo_path, "\\", -1));
- PyRun_SimpleString (g_strdup_printf (
- "import os\n"
- "import sys\n"
- "os.environ['PATH'] = os.getenv('PATH') + ';%s\\\\URE\\\\bin'\n"
- "os.environ['PYTHONPATH'] = '%s\\\\Basis\\\\Program'\n"
- "sys.path.append('%s\\\\Basis\\\\Program')\n"
- "os.environ['URE_BOOTSTRAP'] = 'file:///%s/program/fundamental.ini'\n",
- ooo_path,
- ooo_path,
- ooo_path,
- g_strjoinv ("%20", g_strsplit (g_strjoinv ("/", g_strsplit (priv->ooo_path, "\\", -1)), " ", -1)))
+ PyRun_SimpleString (g_strdup_printf ("import os\n"
+ "import sys\n"
+ "os.environ['PATH'] = os.getenv('PATH') + ';%s\\\\URE\\\\bin'\n"
+ "os.environ['PYTHONPATH'] = '%s\\\\Basis\\\\Program'\n"
+ "sys.path.append('%s\\\\Basis\\\\Program')\n"
+ "os.environ['URE_BOOTSTRAP'] = 'file:///%s/program/fundamental.ini'\n",
+ ooo_path,
+ ooo_path,
+ ooo_path,
+ g_strjoinv ("%20", g_strsplit (g_strjoinv ("/", g_strsplit (priv->ooo_path, "\\", -1)), " ", -1)))
);
#endif
PyRun_SimpleString ("import uno\n"
- "import string\n"
- "local = uno.getComponentContext()\n"
- "resolver = local.ServiceManager.createInstanceWithContext(\"com.sun.star.bridge.UnoUrlResolver\", local)\n"
+ "import string\n"
+ "from com.sun.star.beans import PropertyValue\n"
+ "local = uno.getComponentContext()\n"
+ "resolver = local.ServiceManager.createInstanceWithContext(\"com.sun.star.bridge.UnoUrlResolver\", local)\n"
);
/* controllo se OpenOffice è già in ascolto */
return TRUE;
}
+gboolean
+solipa_ooo_salva_documento_pdf (SolipaOOO *ooo,
+ const gchar *filename)
+{
+ PyObject *obj;
+
+ gchar *_filename;
+
+ SolipaOOOPrivate *priv = SOLIPA_OOO_GET_PRIVATE (ooo);
+
+ _filename = NULL;
+ if (filename != NULL)
+ {
+ _filename = g_strdup (filename);
+ g_strstrip (_filename);
+ }
+
+ g_return_val_if_fail (_filename != NULL && g_strcmp0 (_filename, "") != 0, FALSE);
+
+ PyRun_SimpleString ("property = (PropertyValue (\"FilterName\", 0, \"writer_pdf_Export\", 0), )\n");
+ PyRun_SimpleString (g_strdup_printf ("document.storeToURL(\"file://%s\", property)\n", _filename));
+
+ /* TODO capire se il documento è stato salvato o meno */
+
+ return TRUE;
+}