jorisschellekens / borb

borb is a library for reading, creating and manipulating PDF files in python.
https://borbpdf.com/
Other
3.37k stars 148 forks source link

Bug with MultiColumnLayout #203

Closed beucismis closed 4 months ago

beucismis commented 5 months ago

Describe the bug

Traceback (most recent call last):
  File "/home/user/python/test.py", line 56, in <module>
    main()
  File "/home/user/python/test.py", line 23, in main
    l: PageLayout = MultiColumnLayout(p)
                    ^^^^^^^^^^^^^^^^^^^^
  File "/home/user/.local/lib/python3.11/site-packages/borb/pdf/canvas/layout/page_layout/multi_column_layout.py", line 47, in __init__
    assert len(column_widths) >= 1
           ^^^^^^^^^^^^^^^^^^^^^^^
AssertionError

To Reproduce

Example: https://github.com/jorisschellekens/borb-examples?tab=readme-ov-file#512-removing-pages-from--pdf-documents

Desktop (please complete the following information):

jorisschellekens commented 4 months ago

That should be TwoColumnLayout (which can be imported as from borb.pdf.canvas.layout.page_layout.multi_column_layout import TwoColumnLayout)

I am going to add TwoColumnLayout to the easy imports in the next release, and fix this mistake in the examples.

beucismis commented 4 months ago

Thanks.