alvarcarto / url-to-pdf-api

Web page PDF/PNG rendering done right. Self-hosted service for rendering receipts, invoices, or any content.
MIT License
7.01k stars 774 forks source link

is there a way to set separate margin for each page of pdf? [help wanted] #104

Open amitleuva1987 opened 5 years ago

amitleuva1987 commented 5 years ago

I want to generate a pdf from url. the pdf is getting generated of 2 pages but i want second page to have margins while i don't want margins for the first page of pdf. is it possible?

jack2jm commented 2 years ago

@amitleuva1987

Yes, you can do it. you can put CSS on HTML page like this.

@page{ margin: 0px;margin-bottom: 10px;margin-top: 10px; } //this will be used for all pages @page:first{margin-top: 0px;margin-bottom: 0px;} //this css will used for first page, this is override.