From 393aed9978d4b50be6b9567ee1a8b9238a62e130 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branislav=20Has=CC=8Cto?= Date: Sun, 2 Feb 2020 17:03:29 +0100 Subject: [PATCH] Fix how curveTo2 (v operator) is translated to SVG Based on the PDF spec, with `v` operator, current point should be used as the first control point of the curve. Do not overwrite current point before an SVG curve is built, so it can b actually used as first control point. --- src/display/svg.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/display/svg.js b/src/display/svg.js index aa81a2867..745d66f8c 100644 --- a/src/display/svg.js +++ b/src/display/svg.js @@ -1231,8 +1231,6 @@ if (typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) { j += 6; break; case OPS.curveTo2: - x = args[j + 2]; - y = args[j + 3]; d.push( "C", pf(x), @@ -1242,6 +1240,8 @@ if (typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) { pf(args[j + 2]), pf(args[j + 3]) ); + x = args[j + 2]; + y = args[j + 3]; j += 4; break; case OPS.curveTo3: