Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Jul 2002
    Location
    The sunny side of the Alps
    Posts
    230
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Lightbulb How to implement "page-break-inside:avoid" functionality in reports?

    Hi!

    I have a problem with page breaks in our PDF reports, that are created on the fly from HTML stream (using a PDF generator) - the PDF created this way is then used by various (very important!) users for printing and arhiving.

    As I mentioned there are issues with page breakes - as usually breaks are "inserted" at the end of the page, which is not OK, because there are some parts of the HTML content that must not appear on 2 pages (eg. tables).

    Does anybody know of any solution that would put a page break before specific content in case there is not enough room for that content on the page? Unfortunatelly page-break-inside:avoid command (CSS2) is not supported in IE6/7 or Firefox. Probably, we'll need to calculate the remaining space on the page before each DIV and compare it to the space required by a specific DIV, but don't know how to do it exactly. Is there a method in .NET that we could use for this?

    Thanks so much for your help.
    Bostjan

  • #2
    Senior Coder A1ien51's Avatar
    Join Date
    Jun 2002
    Location
    Between DC and Baltimore In a Cave
    Posts
    2,717
    Thanks
    1
    Thanked 94 Times in 88 Posts
    When I worked with generated PDFs, I had to build functionality to add an element to a temp page, see how big the element was, determine if it could fit or start a new page.

    Sounds like you need to not use a stream or look at the documentation of the pdf api (if you are using one)

    Eric
    Tech Author [Ajax In Action, JavaScript: Visual Blueprint]

  • #3
    Regular Coder
    Join Date
    Jul 2002
    Location
    The sunny side of the Alps
    Posts
    230
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks. We have also been thinking about solutions with TEMP pages, but it quite hard to make everything work properly - especially, because we don't have any experience in that field.

    Today I have also learned from the authors of PDF generator we use, that the new version supports page-break-inside CSS style - we have tested it and it works great.

    Bostjan


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •