You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It appears that the positive direction of y-axis in pdf-lib is down rather than up as per pdf spec. Is this correct? Or am I doing something wrong.
How did you attempt to do it?
In the snippet below, I am drawing a horizontal line at the bottom of the pdf at -2 units. Next I draw a vertical line at x=100. But to get the vertical line upwards, I have to specify a y of -100. It does not work if I specify y=100. Is this supposed to be how it works?
let svgStr = 'M 0,-2 L 1000,-2 M 100,-2 l 0,-100'
page.drawSvgPath(svgStr, {
x: 0,
y: 0,
color: rgb(1.0, 0, 0),
borderWidth: 2
})
What actually happened?
A vertical line from bottom to top should be y=100. Instead it works only if I specify y=-100.
What did you expect to happen?
I expected the line to be drawn from bottom to up when y = 100
What were you trying to do?
It appears that the positive direction of y-axis in pdf-lib is down rather than up as per pdf spec. Is this correct? Or am I doing something wrong.
How did you attempt to do it?
In the snippet below, I am drawing a horizontal line at the bottom of the pdf at -2 units. Next I draw a vertical line at x=100. But to get the vertical line upwards, I have to specify a y of -100. It does not work if I specify y=100. Is this supposed to be how it works?
What actually happened?
A vertical line from bottom to top should be y=100. Instead it works only if I specify y=-100.
What did you expect to happen?
I expected the line to be drawn from bottom to up when y = 100
How can we reproduce the issue?
https://jsfiddle.net/crispduty/spmvwdtk/17/
Version
1.17
What environment are you running pdf-lib in?
Browser
Checklist
Additional Notes
No response
The text was updated successfully, but these errors were encountered: