#HTML VUE NUXT Window.print() pdf

5 messages · Page 1 of 1 (latest)

rain storm
#

With that setup there’s an important limitation:

The browser’s print engine does the pagination for you, and CSS has no way to know which page is last or which is page 2+.

So you cannot say “element X only on last page” or “show green bar only from page 2” with pure CSS while letting the browser auto-break the pages.

To get the layout you showed, you have to build the pages yourself in Vue and then let window.print() print those “page blocks”.

Overall idea

  1. Split your data into pages in Vue (e.g. 20 table rows per page).
  2. Render each page as its own <div class="page"> with header + content + footer.
  3. Use page-break-after in CSS so each .page becomes a physical page.
  4. Use Vue conditionals to show:
    green bar only when pageIndex > 0
    red block only when pageIndex === pages.length - 1
    blue footer on every page
tiny rover
#

then there's another part i didn't tell you

#

My programm is injected in another website

#

so priting could differ