Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.

Enable TCPDF’s automatic page-break mode before writing your generated HTML: configure the page margins, call SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM), add the first page, and then pass the current HTML string to writeHTML(). The bottom break margin reserves space for your footer and keeps flowing content inside the printable page area.

Minimal working pattern for legacy TCPDF

For the legacy tecnickcom/TCPDF library, page breaking is a document setting rather than something you add to every piece of dynamic markup. Set it before rendering any body content.

<?php
require_once __DIR__ . '/tcpdf/tcpdf.php';

$pdf = new TCPDF('P', 'mm', 'A4', true, 'UTF-8', false);
$pdf->SetCreator('Example application');
$pdf->SetAuthor('Example application');
$pdf->SetTitle('Dynamic report');

// Keep the body clear of the header, sides and footer.
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
$pdf->AddPage();

$html = buildYourHtmlFromData($data);
$pdf->writeHTML($html, true, false, true, false, '');
$pdf->Output('report.pdf', 'I');

This is the arrangement used by the official TCPDF example: margins and automatic breaking are configured first, followed by AddPage() and the HTML writer. See the official example_006.php and the TCPDF API reference for the signatures used by your installed release.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What the arguments do

  • TRUE enables automatic breaks.
  • PDF_MARGIN_BOTTOM is the distance reserved at the bottom of each page. It should cover your footer and any clearance required by your layout.
  • The five Boolean/string arguments shown are the legacy writeHTML() signature: enable page-break handling, disable the last-page-only mode, enable line-height adjustment, disable a cell fit-to-content mode, and pass an empty alignment value. Confirm the exact signature against your installed version.

Build dynamic HTML before writing it

Generate the complete markup from current data, then write it once (or in deliberate blocks) after page-break configuration. Escape untrusted values so a customer name or description cannot inject HTML into the PDF.

#1 Best Overall
Corel PDF Fusion Software
  • Save money by using PDF Fusion to view over 100 file formats without having to purchase additional software
  • Merge incompatible files quickly and easily by dragging and dropping in PDF Fusion to create a new PDF documents
  • Save time with PDF Fusion's editing tools to reuse the content from existing documents without starting from scratch
function buildYourHtmlFromData(array $rows): string
{
    $html = '<h1>Orders</h1>';
    $html .= '<table border="1" cellpadding="4" cellspacing="0" width="100%">';
    $html .= '<tr><th>Order</th><th>Description</th><th>Total</th></tr>';

    foreach ($rows as $row) {
        $order = htmlspecialchars((string) $row['order'], ENT_QUOTES, 'UTF-8');
        $description = htmlspecialchars((string) $row['description'], ENT_QUOTES, 'UTF-8');
        $total = htmlspecialchars((string) $row['total'], ENT_QUOTES, 'UTF-8');
        $html .= "<tr><td>{$order}</td><td>{$description}</td><td>{$total}</td></tr>";
    }

    return $html . '</table>';
}

A long table, list or series of paragraphs can then continue onto following pages while TCPDF tracks the remaining body height. Keep the content in the normal page body; writing into a constrained region can change how much space remains.

Choosing the break margin correctly

The break margin is not merely cosmetic. TCPDF stops flowing body content before that distance from the page edge. Set it to the same lower boundary your footer requires, including any footer text, rule, image or spacing.

Typical layout calculation

  1. Decide the page size and orientation, such as A4 portrait.
  2. Set left, top and right margins with SetMargins().
  3. Measure the footer area, including baseline and breathing room.
  4. Pass that lower area to SetAutoPageBreak(TRUE, $bottomMargin).
  5. Render a page containing the longest realistic heading, table row and footer, then inspect the PDF at page boundaries.

Do not assume the constants match a custom header or footer. A footer that is taller than the configured bottom margin can overlap the final body lines even though automatic breaking is enabled.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Writing HTML in blocks and cells

Legacy TCPDF exposes both writeHTML() and writeHTMLCell(). Use writeHTML() for a normal flowing document. Use writeHTMLCell() when you intentionally place HTML inside a cell with explicit coordinates or dimensions, and check how that constrained region interacts with the remaining page height.

Rank #2
MixPad Free Multitrack Recording Studio and Music Mixing Software [Download]
  • Create a mix using audio, music and voice tracks and recordings.
  • Customize your tracks with amazing effects and helpful editing tools.
  • Use tools like the Beat Maker and Midi Creator.
  • Work efficiently by using Bookmarks and tools like Effect Chain, which allow you to apply multiple effects at a time
  • Use one of the many other NCH multimedia applications that are integrated with MixPad.
// Normal flowing content
$pdf->writeHTML($html, true, false, true, false, '');

// A positioned HTML cell; dimensions and coordinates constrain its flow.
$pdf->writeHTMLCell(
    170,       // width
    0,         // height: allow TCPDF to determine it
    20,        // x
    '',        // y: current position
    $html,
    0,
    1,
    false,
    true,
    '',
    true
);

Because the writeHTMLCell() signature has more layout parameters, verify the order in your release’s API documentation before copying a call. If a block must be allowed to span pages, avoid putting it in a fixed-height or otherwise restricted region unless that behavior is explicitly supported by your version.

Legacy TCPDF versus current tc-lib-pdf

The project’s current HTML/CSS guide describes the newer tc-lib-pdf API, not the legacy TCPDF class. Its guidance is explicit: “Use addHTMLCell() for anything that may span a page break.” The companion getHTMLCell() returns PDF operators without writing them.

Package/API Flowing HTML method When to use
Legacy TCPDF writeHTML() or writeHTMLCell() Projects installed with the TCPDF class; confirm the local method signature.
Current tc-lib-pdf addHTMLCell() HTML blocks that may continue across a page or region break.
Current tc-lib-pdf getHTMLCell() When you need PDF operators returned rather than written immediately.

Do not paste addHTMLCell() into a legacy TCPDF project without confirming the package and version. The official HTML/CSS guide is at tcpdf.org/docs/html-css/; the examples index, including the HTML block flow example E018, is at tcpdf.org/examples/.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Why content still overlaps, stops or breaks oddly

Automatic mode was never enabled

Symptom: the first page fills beyond the footer or later content is clipped. Fix: call SetAutoPageBreak(TRUE, $bottomMargin) before writeHTML(), and do not accidentally pass FALSE from a configuration variable.

Rank #3
DeskFX Free Audio Effects & Audio Enhancer Software [PC Download]
  • Transform audio playing via your speakers and headphones
  • Improve sound quality by adjusting it with effects
  • Take control over the sound playing through audio hardware

The bottom margin is too small

Symptom: the last body line collides with footer text. Fix: increase the break margin to include the complete footer and regenerate the PDF. Remember that the margin is reserved from every page, not just the last one.

A custom header or footer changes the usable area

Symptom: pages with a larger header or footer behave differently from pages without one. Fix: align SetMargins() and the break margin with the actual header/footer drawing code. A default constant cannot know the dimensions of your custom layout.

The HTML is inside a constrained region

Symptom: a block stops at a cell boundary or leaves unexpected white space. Fix: test the same markup with ordinary writeHTML(); remove fixed heights where possible; and inspect the writeHTMLCell() coordinates, width and height.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The markup is unsupported or malformed

Symptom: a tag disappears, a table shifts, or a page boundary occurs at an unexpected point. Fix: reduce the document to a small valid fragment, then add tags and CSS incrementally. TCPDF’s HTML support is not a browser engine, and the supported subset can vary by release. Consult the documentation matching your installed package.

Rank #4
Single Use Temperature Data Logger with Light Sensor 10000 Points Capacity USB Interface for PDF Report Generation Software Free Configuration LED Indicator for Alarm Status and
  • Single Use Monitoring: This data logger is designed for one time use and features integrated light and temperature sensors to provide data collection with .
  • Software Free Configuration: The device supports online configuration without the requirement to install any software for a quick and easy setup process.
  • Integrated USB Connector: The plug and read design allows for direct connection to computers without the use of external cables or readers for access to recorded information.
  • Automated PDF Reports: Upon connection the device generates a comprehensive PDF report including temperature statistics in Celsius or Fahrenheit and alarm status for documentation.
  • High Capacity Recording: The unit stores up to 10000 temperature points and utilizes LED indicators to display recording information including alarm status and statistics.

Arguments do not match the installed release

Symptom: a warning, type error or different layout appears after an upgrade or when code is copied from another project. Fix: inspect the local class declaration and the API reference for that version, then update the call rather than relying on positional arguments remembered from another release.

Testing long, real-world documents

  • Generate zero rows, one row, and enough rows to fill several pages.
  • Include a row whose description wraps to many lines.
  • Test headings immediately before a page boundary and tables wider than the body area.
  • Inspect pages with and without the footer, in both portrait and landscape layouts if your application supports both.
  • Check that sensitive values are escaped and that a failed data query does not leave an incomplete HTML fragment.

Keep a representative PDF fixture in automated tests if pagination is business-critical. Exact line wrapping can change with fonts, images, library versions and available resources, so validate the visual result in addition to checking that generation completes.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

If your actual goal is to capture a web page rather than generate a PDF with PHP, ScreenshotNeo provides a single HTTP request for a PNG, JPEG, WebP or PDF. It accepts cookie and consent banners before capture and removes more than 60 known consent platforms, newsletter popups and chat widgets; bot checks, blank pages, timeouts, failed loads and cache hits are not billed, and the response identifies the result with X-Page-Verdict and X-Billed headers. Its MCP server lets Claude, Cursor and other MCP clients call take_screenshot, get_page_info and capture_pdf.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use the API documentation at screenshotneo.com/docs/ for all options, including full-page lazy-image loading, CSS-selector element capture, device and retina settings, PDF paper and page-range controls, custom CSS/JavaScript, waits, request blocking, headers, cookies, user agents, authorization, timezone, geolocation, transparent backgrounds, resizing, configurable-TTL caching, signed links, asynchronous webhooks, bulk capture and usage reporting.

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
r.raise_for_status()
open("shot.webp", "wb").write(r.content)
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
if (!res.ok) throw new Error(`HTTP ${res.status}`);
const fs = await import('node:fs/promises');
await fs.writeFile('shot.webp', Buffer.from(await res.arrayBuffer()));

The Free plan includes 1,000 screenshots per month with no card. Paid plans start at $5 for 3,000 shots; every feature is available on every plan. Create a free ScreenshotNeo account to try it.

Best Value
WavePad Audio Editing Software - Professional Audio and Music Editor for Anyone [Download]
  • Full-featured professional audio and music editor that lets you record and edit music, voice and other audio recordings
  • Add effects like echo, amplification, noise reduction, normalize, equalizer, envelope, reverb, echo, reverse and more
  • Supports all popular audio formats including, wav, mp3, vox, gsm, wma, real audio, au, aif, flac, ogg and more
  • Sound editing functions include cut, copy, paste, delete, insert, silence, auto-trim and more
  • Integrated VST plugin support gives professionals access to thousands of additional tools and effects

Frequently asked questions

Can I force a manual page break?

You can add a new page deliberately with TCPDF’s page-management methods, but automatic flow should remain enabled for unpredictable dynamic content. A manual break is best reserved for a known section boundary.

Does enabling automatic breaks guarantee every HTML tag will split cleanly?

No. Page flow depends on supported markup, margins, fonts, images, tables and whether content is inside a constrained region. Validate the tags and release-specific behavior you use.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Should I use the newer API in an existing TCPDF application?

Only after confirming that the application uses the current tc-lib-pdf package. Legacy TCPDF code should continue using its documented writeHTML() or writeHTMLCell() methods.

Quick Recap

Bestseller No. 1
Bestseller No. 2
MixPad Free Multitrack Recording Studio and Music Mixing Software [Download]
MixPad Free Multitrack Recording Studio and Music Mixing Software [Download]
Create a mix using audio, music and voice tracks and recordings.; Customize your tracks with amazing effects and helpful editing tools.
Bestseller No. 3
DeskFX Free Audio Effects & Audio Enhancer Software [PC Download]
DeskFX Free Audio Effects & Audio Enhancer Software [PC Download]
Transform audio playing via your speakers and headphones; Improve sound quality by adjusting it with effects

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.