Chrome extension · coming soon
All guides
Code FormattingPDF PaginationDeveloper Tools

Fixing Cut-Off Code Blocks and Tables When Printing ChatGPT & Gemini to PDF

2026-10-17 · 1 min read · 繁體中文版 →

How deterministic @media print pagination rules prevent mid-block slicing across A4 page boundaries.

The Developer's Nightmare: Sliced Code Blocks Across Pages

Engineers rely on ChatGPT and Claude to draft system design RFCs, review SQL queries, and document APIs. Yet standard browser printing and canvas-based PDF extensions routinely slice 20-line code blocks and comparison tables in half across page breaks.


Atomic Block Preservation in Folio Press

Folio Press enforces strict CSS pagination constraints across every theme so structural blocks remain intact and headings never sit orphaned at the bottom of a page:

css@page {
  size: A4 portrait;
  margin: 14mm 16mm;
}

@media print {
  pre, table, blockquote, .avoid-break {
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }
  h1, h2, h3 {
    break-after: avoid !important;
    page-break-after: avoid !important;
  }
}

You can also toggle between Editorial Light and Terminal Dark code block themes right in the studio sidebar before exporting.

Typeset your own conversation now.Open the studio