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

Is it possible to have it automatically create new pages once the sheet overflows? #12

Open
jedallado opened this issue May 26, 2017 · 9 comments
Labels

Comments

@jedallado
Copy link

Currently you'll have to define "sheet" for each page, but I am looping long list of data so I only created one sheet. The problem is after the end of the sheet the rest of the data gets hidden and not printed.

@cognitom
Copy link
Owner

Hi @bionets.
paper-css is just a set of CSS, so we need to do pagination manually.

@JulienMelissas
Copy link

Hi @bionets... I know this is old, but I was able to do this pretty easily by just adding a style:

.sheet {
  overflow: visible;
  height: auto !important;
}

I was also able to avoid the browser printing half an element on one page and the other half on the next by adding page-break-inside: avoid; to the repeating items I had, in my case it was a simple div.

@danilockthar
Copy link

danilockthar commented May 11, 2021

page-break-inside: avoid;

Hi, how you avoid the next page enters with no padding on top ? i try your solution but when content is too big, the next page is close to the border top of the page.

@lpwm
Copy link

lpwm commented Jun 26, 2021

page-break-inside: avoid;

Hi, how you avoid the next page enters with no padding on top ? i try your solution but when content is too big, the next page is close to the border top of the page.

Same issue +1

@TriPSs
Copy link

TriPSs commented Jun 27, 2021

@lpwm @danilockthar try adding:

@page {
   size: A4;
   margin: 15mm 15mm 15mm 15mm;
}

@lpwm
Copy link

lpwm commented Jun 27, 2021

@lpwm @danilockthar try adding:

@page {
   size: A4;
   margin: 15mm 15mm 15mm 15mm;
}

Finally found the issue was caused by a div with growing height and ignored the paddings.

@franky1017
Copy link

page-break-inside: avoid;

Hi, how you avoid the next page enters with no padding on top ? i try your solution but when content is too big, the next page is close to the border top of the page.

Same issue +1

@lpwm @danilockthar try adding:

@page {
   size: A4;
   margin: 15mm 15mm 15mm 15mm;
}

I tried this and didn't work. Is there a sample code that contains the full CSS and page content that goes across multiple pages? Thanks!

@fgonga
Copy link

fgonga commented Jul 7, 2022

I solved it

@page {
            size: A4;
            margin: 5mm 0mm ;
        }
.sheet {
            overflow: visible;
            height: auto !important;
        }

@zerdotre
Copy link

@cognitom When looping through data, is there any way we can know when a page is full? and then start/open a new sheet.

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

No branches or pull requests

9 participants