diff options
| author | bulia byak <buliabyak@gmail.com> | 2009-04-30 21:09:18 +0000 |
|---|---|---|
| committer | buliabyak <buliabyak@users.sourceforge.net> | 2009-04-30 21:09:18 +0000 |
| commit | 84239fe38ae3819eaa06ffa32772ad54182bd23d (patch) | |
| tree | 17cf0303f6edb19c8ab493544712f6bf488550c3 | |
| parent | Fix infinite loop as reported in bug #365034 (diff) | |
| download | inkscape-84239fe38ae3819eaa06ffa32772ad54182bd23d.tar.gz inkscape-84239fe38ae3819eaa06ffa32772ad54182bd23d.zip | |
allow --export-dpi to be used for setting the filter rasterization resolution in PS/EPS/PDF export
(bzr r7801)
| -rw-r--r-- | inkscape.pod | 7 | ||||
| -rw-r--r-- | src/main.cpp | 13 |
2 files changed, 17 insertions, 3 deletions
diff --git a/inkscape.pod b/inkscape.pod index afc364ec9..720a111b6 100644 --- a/inkscape.pod +++ b/inkscape.pod @@ -140,7 +140,9 @@ then the page color set in Inkscape in the Document Options dialog will be used =item B<-d> I<DPI>, B<--export-dpi>=I<DPI> The resolution used for PNG export. -The default is 90, which corresponds to 1 SVG user unit +It is also used for fallback rasterization of filtered objects +when exporting to PS, EPS, or PDF (unless you specify --export-ignore-filters to suppress +rasterization). The default is 90 dpi, which corresponds to 1 SVG user unit (px, also called "user unit") exporting to 1 bitmap pixel. This value overrides the DPI hint if used with --export-use-hints. @@ -271,7 +273,8 @@ Convert text objects to paths on export, where applicable (for PS, EPS, and PDF =item B<--export-ignore-filters> -Export filtered objects (e.g. those with blur) as vectors, ignoring the filters (for PS, EPS, and PDF export). By default, all filtered objects are rasterized, preserving the appearance. +Export filtered objects (e.g. those with blur) as vectors, ignoring the filters (for PS, EPS, and PDF export). +By default, all filtered objects are rasterized at --export-dpi (default 90 dpi), preserving the appearance. =item B<-I>, B<--query-id> diff --git a/src/main.cpp b/src/main.cpp index 05cfc8578..d6da78a97 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -291,7 +291,7 @@ struct poptOption options[] = { {"export-dpi", 'd', POPT_ARG_STRING, &sp_export_dpi, SP_ARG_EXPORT_DPI, - N_("The resolution used for exporting SVG into bitmap (default 90)"), + N_("Resolution for exporting to bitmap and for rasterization of filters in PS/EPS/PDF (default 90)"), N_("DPI")}, {"export-area", 'a', @@ -1477,6 +1477,17 @@ static void do_export_ps_pdf(SPDocument* doc, gchar const* uri, char const* mime (*i)->set_param_bool("blurToBitmap", FALSE); } else { (*i)->set_param_bool("blurToBitmap", TRUE); + + gdouble dpi = 90.0; + if (sp_export_dpi) { + dpi = atof(sp_export_dpi); + if ((dpi < 72) || (dpi > 2400.0)) { + g_warning("DPI value %s out of range [72 - 2400]. Using 90 dpi instead.", sp_export_dpi); + dpi = 90; + } + } + + (*i)->set_param_int("resolution", (int) dpi); } (*i)->save(doc, uri); |
