PDFs are designed for printing and viewing at fixed page sizes. Unlike web pages that scroll infinitely, PDFs paginate content. Understanding page layout ensures professional, print-ready output.
Page Sizes and Margins
Common page sizes: A4 (210×297mm, standard in most countries), Letter (8.5×11 inches, US standard), Legal (8.5×14 inches). Set margins of 0.5-1 inch (12-25mm) on all sides for readability and printer safety. Content too close to edges may be cut off when printed. Specify page size and orientation (portrait/landscape) in PDF API parameters.
Page Breaks and Flow
Control where pages break using CSS: page-break-before, page-break-after, page-break-inside. Avoid breaking tables or lists across pages (page-break-inside: avoid). Insert manual breaks before major sections (page-break-before: always). For invoices and reports, start each invoice/report on a new page. Proper page breaks make PDFs more readable and professional.