Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

    @media print {
      @page {
        @bottom-center { content: counter(page) }
      }
works with https://pagedjs.org


And it's not just a Paged.js thing. No "hacks" necessary.

https://www.w3.org/TR/css-page-3/#page-based-counters


What browser does it work in natively? I tried this a couple of years ago and a few people claimed that it worked in kiosk mode for Chrome but I couldn't get it to work in any browser.


It looks like it should be available in all major browsers.

https://developer.mozilla.org/en-US/docs/Web/CSS/@page#brows...

That said, I've always used paged.js with its polyfills to fill in other gaps. So maybe there's something I'm unaware of.


@page probably works for some things but when I tried to do page numbers it definitely didn't. I ended up hacking something together (absolute positioning a number every ~700px or whatever so it sat on the same place each page).


paged.js is a polyfill that implements this. I'm not aware of any browser that support this.

Why do you call paged.js a "hack"?


My quoted "hacks" was in response to the parent "impossible with css hacks".

I'm a big fan of paged.js.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: