-
-
Notifications
You must be signed in to change notification settings - Fork 148
Open
Description
Describe the bug
When adding text to an existing PDF the characters are inverted.
To Reproduce
- download this PDF https://assets.publishing.service.gov.uk/government/uploads/system/uploads/attachment_data/file/1145516/sa800man_2023.pdf
- rename to SA800.pdf
- put it in the same directory as the following script
- run the script
from borb.pdf import Paragraph
from borb.pdf import PDF
from borb.pdf.canvas.geometry.rectangle import Rectangle
from decimal import Decimal
def main():
with open("SA800.pdf", "rb") as in_file_handle:
doc = PDF.loads(in_file_handle)
page = doc.get_page(0)
r = Rectangle(Decimal(0), Decimal(0), Decimal(200), Decimal(200))
Paragraph("Hello World!", font="Courier").paint(page, r)
with open("output.pdf", "wb") as pdf_file_handle:
PDF.dumps(pdf_file_handle, doc)
if __name__ == "__main__":
main()
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.
Metadata
Metadata
Assignees
Labels
No labels