"Print/export to PDF" list with the view layout

I would like to “print /export to PDF” a table. But instead of printing it with the “List Page” layout, I’d like to print each record with the “View Page” layout with page breaks between the records.

How can I achieve this?

You may try and see if the following works for exporting to PDF:

  1. In advanced settings of the dompdf extension, enable ExportList (you should export in the List page) and set the PageBreakRecordCount as 1.
  2. Use Page_Exporting server event to set $doc->setHorizontal(false).

As for "print", you cannot insert page breaks because the printer-friendly version uses the same HTML you see in the browser, However, you may try Export to HTML, you'll need to customize the export class (i.e. the ExportHtml class) and implement the exportPageBreak() method similar to that in the ExportPdf class.