0

I'm sorry if this is obvious, but I couldn't find an answer. I want to use CSS @print to save my page as a PDF. The content is different for every page. How can I save it as one long, continuous document instead of dividing it into pages (A4)? Let's say I want to have the width set to 800px. What should I set the height to?

@media print {

    @page{ 
        margin:0;
        size:800px auto;
    }

    /* The rest of the @print code */

}

The line with size:800px auto doesn't work. Is there a "nice" way to do it? I'd prefer a CSS solution, but eventually, it can be in JS too.

Astw41
  • 394
  • 3
  • 12
  • Related question: https://stackoverflow.com/questions/72195698/i-want-to-generate-page-as-a-single-pdf-file-without-page-break – freedomn-m Nov 14 '22 at 14:53
  • @freedomn-m Unfortunately, I don't think it answers my question. I want a CSS / JS / jQuery solution, no plugins. – Astw41 Nov 14 '22 at 15:51

0 Answers0