Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix how curveTo2 (v operator) is translated to SVG #11559

Merged
merged 1 commit into from
Feb 6, 2020

Conversation

bhasto
Copy link
Contributor

@bhasto bhasto commented Feb 2, 2020

Based on PDF spec, page 133, 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 be actually used as first control point.

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.
@timvandermeij
Copy link
Contributor

timvandermeij commented Feb 3, 2020

Interesting. Do you have an actual PDF file that is broken because of this? I think the fix is fine because we do that already in the canvas back-end; see:

pdf.js/src/display/canvas.js

Lines 1229 to 1241 in 794744c

case OPS.curveTo2:
ctx.bezierCurveTo(
x,
y,
args[j],
args[j + 1],
args[j + 2],
args[j + 3]
);
x = args[j + 2];
y = args[j + 3];
j += 4;
break;

@bhasto
Copy link
Contributor Author

bhasto commented Feb 4, 2020

Unfortunately I don’t have an image readily available that I could share in a public forum.

I can try to come up with one, but I don’t have experience creating PDFs, so it’ll take some time.

@timvandermeij
Copy link
Contributor

/botio-linux preview

@pdfjsbot
Copy link

pdfjsbot commented Feb 6, 2020

From: Bot.io (Linux m4)


Received

Command cmd_preview from @timvandermeij received. Current queue size: 0

Live output at: http://54.67.70.0:8877/d8d1fadeabd0e65/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Feb 6, 2020

From: Bot.io (Linux m4)


Success

Full output at http://54.67.70.0:8877/d8d1fadeabd0e65/output.txt

Total script time: 1.74 mins

Published

@timvandermeij timvandermeij merged commit e12e837 into mozilla:master Feb 6, 2020
@timvandermeij
Copy link
Contributor

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants