PDF second page no margin

I purchased the white label license and use the design “calm”.

Whenever I add to many items to my invoice, an automatic page break happens as intended.
But text directly continues on the second page, without any distance to the top of the page…
Example of a second page can be found here: https://imgur.com/a/4TYoEFc

How can I add some spacing to the top of following pages?
Thank you in advance!
Florian

Hi,

@david can you please advise?

@itworks

Is that a background image that you have configured there?

yes, I have done it this way:

body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        font-family: $font_name, Helvetica, sans-serif;
        font-size: "$font_size";
        zoom: 80%;
background-image: url('https://******/images/pdf-designs/briefpapier.jpg');
    background-position: center top;
    background-size: 100% auto;
    }

So the styling would not know about the background image here, hence the overlap.

What i would suggest here is trying to apply the background only to the first page, the following block may work:

body { 
  background: url(...............jpy) no-repeat center center fixed; 
  -webkit-background-size: cover;
  -moz-background-size: cover;
  -o-background-size: cover;
  background-size: cover;
}```

Hi David,

applying the background image to the first page only works, thank you for that.

But invoices still dont’t look good, as there is no top margin applied on the second page…: https://imgur.com/a/cpl4NdD

Same happens when using the original “Calm” Design, it does not depend on the background picture.
I need to define some kind of offset to the top of following/second pages…

This could also be a header with a couple of line breaks, that is only applied to following pages… just an idea…

Hi @itworks

This is how I achieve that:

    @page {
        margin-left: 0cm;
        margin-right: 0cm;
        margin-top: 2cm;
        margin-bottom: 0cm;
        size: $page_size $page_layout;
    }

    @page :first {
        /* You can only change the size, margins, orphans, widows and page breaks here */

        /* Paper size and page orientation */
        size: A4 portrait;

        /* Margin per single side of the page */
        margin-left: 0cm;
        margin-top: 0cm;
        margin-right: 0cm;
        margin-bottom: 2cm;
    }
2 Likes

That indeed gives me control about the top magin only for the second page.
PERFECT, THANK YOU VERY MUCH!!

1 Like