Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added support page-break-before:always and page-break-after:always #30

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

laszlocseko
Copy link

Please review my changes.

Thanks,
László

@csekol csekol mentioned this pull request Oct 9, 2017
@hydra1983
Copy link

Not working in 8.0.1-SNAPSHOT.

A solution would be

private void addPageBreakBefore(BlockBox box) {
        Map<String, CSSValue> cssMap = getCascadedProperties(box.getStyle());

        CSSValue pageBreakAfter = cssMap.get("page-break-before");
        if("always".equals(pageBreakAfter.getCssText())){

            Br br = Context.getWmlObjectFactory().createBr();
            br.setType(PAGE);

            R r = Context.getWmlObjectFactory().createR();
            r.getContent().add(br);

            getListForRun().getContent().add(r);
        }
    }

    private void addPageBreakAfter(BlockBox box) {
        Map<String, CSSValue> cssMap = getCascadedProperties(box.getStyle());

        CSSValue pageBreakAfter = cssMap.get("page-break-after");
        if("always".equals(pageBreakAfter.getCssText())){
            Br br = Context.getWmlObjectFactory().createBr();
            br.setType(PAGE);

            R r = Context.getWmlObjectFactory().createR();
            r.getContent().add(br);

            getListForRun().getContent().add(r);
        }
    }

@fnicollet
Copy link

Hello,
The patch, using @hydra1983 code from the comment works very well. Any chance this PR can be merged?
It's been 3 years now, so if another PR should be created instead of this one, let me know and i'll happily do the PR

Thanks,
Fabien

@fnicollet
Copy link

@plutext Hello, here is the PR, ready to be merged in the 8.x branch:
#95
I believe it can also be cherry-picked in the 11.x branch

Thanks,
Fabien

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants