ralfstuckert / pdfbox-layout

MIT License
156 stars 74 forks source link

ArrayIndexOutOfBoundsException when dividing a frame #90

Open tobihein opened 2 years ago

tobihein commented 2 years ago

I use pdfbox2-layout 1.0.1 with pdfbox 2.0.23. I get the following Exception when I create my pdf-document

Caused by: java.lang.ArrayIndexOutOfBoundsException: Index 1 out of bounds for length 1
    at java.base/java.util.concurrent.CopyOnWriteArrayList.elementAt(CopyOnWriteArrayList.java:385)
    at java.base/java.util.concurrent.CopyOnWriteArrayList.get(CopyOnWriteArrayList.java:398)
    at rst.pdfbox.layout.elements.Frame.divideList(Frame.java:662)
    at rst.pdfbox.layout.elements.Frame.divide(Frame.java:608)
    at rst.pdfbox.layout.elements.render.VerticalLayout.layoutAndDrawReleative(VerticalLayout.java:206)
    at rst.pdfbox.layout.elements.render.VerticalLayout.renderReleative(VerticalLayout.java:148)
    at rst.pdfbox.layout.elements.render.VerticalLayout.render(VerticalLayout.java:96)
    at rst.pdfbox.layout.elements.render.VerticalLayout.render(VerticalLayout.java:79)
    at rst.pdfbox.layout.elements.render.RenderContext.render(RenderContext.java:309)
    at rst.pdfbox.layout.elements.Document.render(Document.java:299)
    at rst.pdfbox.layout.elements.Document.save(Document.java:341)
    at rst.pdfbox.layout.elements.Document.save(Document.java:327)

Currently I'm not able to provide you more than the stacktrace. In my opinion, this is a bug. If it is more a problem in my pdf, please help me.

But I'll try to make a reproducable minimal example and even a merge-request.