diff options
| author | Markus Engel <markus.engel@tum.de> | 2013-04-20 21:21:33 +0000 |
|---|---|---|
| committer | Markus Engel <markus.engel@tum.de> | 2013-04-20 21:21:33 +0000 |
| commit | 39580f4b417374ccba9d504f028388b2a2932506 (patch) | |
| tree | a4337231a1b27403dceb49810ea618297ed0b659 /src/main.cpp | |
| parent | Merging of EventContext classes complete. (diff) | |
| parent | Group bbox update (Bug 1168979) (diff) | |
| download | inkscape-39580f4b417374ccba9d504f028388b2a2932506.tar.gz inkscape-39580f4b417374ccba9d504f028388b2a2932506.zip | |
merged from trunk (r12287)
(bzr r11608.1.99)
Diffstat (limited to 'src/main.cpp')
| -rw-r--r-- | src/main.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp index cb8d12a0f..e63373695 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -134,6 +134,7 @@ enum { SP_ARG_EXPORT_AREA, SP_ARG_EXPORT_AREA_DRAWING, SP_ARG_EXPORT_AREA_PAGE, + SP_ARG_EXPORT_MARGIN, SP_ARG_EXPORT_AREA_SNAP, SP_ARG_EXPORT_WIDTH, SP_ARG_EXPORT_HEIGHT, @@ -185,6 +186,7 @@ static gchar *sp_export_dpi = NULL; static gchar *sp_export_area = NULL; static gboolean sp_export_area_drawing = FALSE; static gboolean sp_export_area_page = FALSE; +static gchar *sp_export_margin = NULL; static gboolean sp_export_latex = FALSE; static gchar *sp_export_width = NULL; static gchar *sp_export_height = NULL; @@ -228,6 +230,7 @@ static void resetCommandlineGlobals() { sp_export_area = NULL; sp_export_area_drawing = FALSE; sp_export_area_page = FALSE; + sp_export_margin = NULL; sp_export_latex = FALSE; sp_export_width = NULL; sp_export_height = NULL; @@ -315,6 +318,11 @@ struct poptOption options[] = { N_("Exported area is the entire page"), NULL}, + {"export-margin", 0, + POPT_ARG_STRING, &sp_export_margin, SP_ARG_EXPORT_MARGIN, + N_("Only for PS/EPS/PDF, sets margin in mm around exported area (default 0)"), + N_("VALUE")}, + {"export-area-snap", 0, POPT_ARG_NONE, &sp_export_area_snap, SP_ARG_EXPORT_AREA_SNAP, N_("Snap the bitmap export area outwards to the nearest integer values (in SVG user units)"), @@ -1622,6 +1630,13 @@ static int do_export_ps_pdf(SPDocument* doc, gchar const* uri, char const* mime) (*i)->set_param_int("resolution", (int) dpi); } + // if no bleed/margin is given, set to 0 (otherwise it takes the value last used from the UI) + float margin = 0.; + if (sp_export_margin) { + margin = g_ascii_strtod(sp_export_margin, NULL); + } + (*i)->set_param_float("bleed", margin); + //check if specified directory exists if (!Inkscape::IO::file_directory_exists(uri)) { g_warning("File path \"%s\" includes directory that doesn't exist.\n", uri); |
