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
Expected behaviour
I would expect this to render "Hello World!" somewhere near the top of the page
Screenshots
Desktop (please complete the following information):
OS: mac
borb version 2.1.12
input PDF: see steps to reproduce
Additional context
The coordinates of the rectangle aren't behaving as I would expect either, increasing the width seemingly makes the rectangle taller, and visa versa.
The text was updated successfully, but these errors were encountered:
I have a correction. Using the above script renders text correctly. Noteably downloading the PDF from the original source seems to make a difference. I was running the script originally with this PDF which produced the errors: SA800.pdf
The content of a PDF is located in a so called content stream.
These streams are essentially compressed pieces of code (in a language called postfix) that tell the viewing software how to render content.
In pseudo-code you might find something such as:
go to coordinate 80, 120
set the font color to black
set the font to Helvetica, size 12
render the character "H"
etc
As you can tell from the pseudo-code, the renderer has a state (coordinates, colors, active font, etc).
There are operators that modify this state even further. For instance you can apply a matrix transformation to the coordinate system.
Normally, you would encapsulate content-rendering operations with a q and Q respectively. These operators tell the viewer to store the graphic state and restore the graphics state.
Your issue might be something like:
the PDF already contains a matrix transform
the PDF does not restore the state
borb appends content, expecting the state to be the default, leading to the wrong output
Describe the bug
When adding text to an existing PDF the characters are inverted.
To Reproduce
Expected behaviour
I would expect this to render "Hello World!" somewhere near the top of the page
Screenshots
Desktop (please complete the following information):
Additional context
The coordinates of the rectangle aren't behaving as I would expect either, increasing the width seemingly makes the rectangle taller, and visa versa.
The text was updated successfully, but these errors were encountered: