summaryrefslogtreecommitdiff
path: root/Build/source/texk/dvisvgm/dvisvgm-src/src/EPSToSVG.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/texk/dvisvgm/dvisvgm-src/src/EPSToSVG.cpp')
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-src/src/EPSToSVG.cpp43
1 files changed, 24 insertions, 19 deletions
diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/EPSToSVG.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/EPSToSVG.cpp
index 0fb638b6667..ec50c21c487 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-src/src/EPSToSVG.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/EPSToSVG.cpp
@@ -2,7 +2,7 @@
** EPSToSVG.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2016 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2017 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
@@ -18,17 +18,16 @@
** along with this program; if not, see <http://www.gnu.org/licenses/>. **
*************************************************************************/
-#include <config.h>
#include <fstream>
#include <sstream>
-#include "EPSFile.h"
-#include "EPSToSVG.h"
-#include "Message.h"
-#include "MessageException.h"
-#include "PsSpecialHandler.h"
-#include "SVGOutput.h"
-#include "System.h"
-
+#include "EPSFile.hpp"
+#include "EPSToSVG.hpp"
+#include "Message.hpp"
+#include "MessageException.hpp"
+#include "PsSpecialHandler.hpp"
+#include "SVGOutput.hpp"
+#include "System.hpp"
+#include "version.hpp"
using namespace std;
@@ -67,16 +66,22 @@ void EPSToSVG::convert () {
progress(0);
// output SVG file
_svg.setBBox(_bbox);
- _svg.appendToDoc(new XMLCommentNode(" This file was generated by dvisvgm " VERSION " "));
- _svg.write(_out.getPageStream(1, 1));
+ _svg.appendToDoc(new XMLCommentNode(" This file was generated by dvisvgm " + string(PROGRAM_VERSION) + " "));
+ bool success = _svg.write(_out.getPageStream(1, 1));
string svgfname = _out.filename(1, 1);
- const double bp2pt = 72.27/72;
- const double bp2mm = 25.4/72;
- Message::mstream(false, Message::MC_PAGE_SIZE) << "graphic size: " << XMLString(bbox.width()*bp2pt) << "pt"
- " x " << XMLString(bbox.height()*bp2pt) << "pt"
- " (" << XMLString(bbox.width()*bp2mm) << "mm"
- " x " << XMLString(bbox.height()*bp2mm) << "mm)\n";
- Message::mstream(false, Message::MC_PAGE_WRITTEN) << "output written to " << (svgfname.empty() ? "<stdout>" : svgfname) << '\n';
+ if (svgfname.empty())
+ svgfname = "<stdout>";
+ if (!success)
+ Message::wstream() << "failed to write output to " << svgfname << '\n';
+ else {
+ const double bp2pt = 72.27/72;
+ const double bp2mm = 25.4/72;
+ Message::mstream(false, Message::MC_PAGE_SIZE) << "graphic size: " << XMLString(bbox.width()*bp2pt) << "pt"
+ " x " << XMLString(bbox.height()*bp2pt) << "pt"
+ " (" << XMLString(bbox.width()*bp2mm) << "mm"
+ " x " << XMLString(bbox.height()*bp2mm) << "mm)\n";
+ Message::mstream(false, Message::MC_PAGE_WRITTEN) << "output written to " << svgfname << '\n';
+ }
}