ralfstuckert/pdfbox-layout

New page rotation issue

Opened this issue · 0 comments

Look like a bug in condition: isPageTilted() - it always returns false.

RenderContext.java

public void newPage() throws IOException {
        ...
        this.page = new PDPage(getPageFormat().getMediaBox());
        ....
	// fix orientation
	if (getPageOrientation() != getPageFormat().getOrientation()) {
	    if (isPageTilted()) {                   // <---- HERE IS BUG!
		page.setRotation(0);
	    } else {
		page.setRotation(90);
	    }
	}

Possible fix:

if (getPageFormat().getOrientation() == Orientation.Landscape) {
    page.setRotation(90);
}