Skip to content
This repository has been archived by the owner on Feb 11, 2024. It is now read-only.

Which is the correct way to add a break page ? #14

Open
danieltellez opened this issue Sep 2, 2013 · 2 comments
Open

Which is the correct way to add a break page ? #14

danieltellez opened this issue Sep 2, 2013 · 2 comments

Comments

@danieltellez
Copy link

This is how I am doing:

    stylename = str(uuid.uuid1())
    break_style = odf_create_style('text', stylename, break_before='page')
    break_style.set_properties(page_break_before='page', area="paragraph")
    self.report.insert_style(break_style)
    breakp = odf_create_paragraph('', stylename)
    body = self.report.get_body()
    body.append(breakp)

And it is not working. I've also tried with a paragraph with some text.

@danieltellez
Copy link
Author

Here is the way it works for me :

        section_style_name = str(uuid.uuid1())
        section_style = odf_create_style('paragraph', section_style_name)
        section_style.set_properties(page_break_before='page', area="paragraph")
        self.report.insert_style(section_style)
        breakp_paragraph = odf_create_paragraph('', section_style_name)
        body.append(breakp_paragraph)

Sorry for the noise.

@danieltellez
Copy link
Author

Only one more thing: I had to uncomment and modify these lines on utils.py, in _expand_properties function :

           'page_break_before': 'fo:break-before',
           'page_break_after': 'fo:break-after',

@danieltellez danieltellez reopened this Sep 2, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant