Files are processed in your browser, not uploaded. Privacy →
Skip to guide

Extract text

How to add page breaks to extracted PDF text

By DeckleUpdated

To add page breaks to extracted PDF text, open PDF to text, choose your PDF, select Mark where each page ended under Between pages, then choose Extract text. Deckle puts a form-feed character, the standard page-break code, on its own line between every page. Many text editors hide that character, so the breaks can look missing when they are there; search for it or replace it with a visible label such as --- page ---.

PDF to text

Page separators may be present but invisible

Mark where each page ended

Uses the U+000C form-feed character

One continuous document

Separates extracted pages with a blank line

Inspect the saved text in an editor that shows its separators

Conceptual comparison · a text editor may hide form feeds; neither separator recreates page formatting.

How to keep page breaks in a PDF text export

  1. Open PDF to text and choose your PDF, or drop it onto the page.
  2. Under Pages and order, keep All pages so the page breaks line up with the PDF's own pages.
  3. Under Between pages, choose Mark where each page ended. The note beside it reads "Adds a page-break character between pages."
  4. Choose Extract text.
  5. Download the TXT file and open it in a plain text editor.
  6. Search for the form-feed character, or count the separators: a 20-page PDF has 19.

The other option, One continuous document, puts a blank line between pages instead. Choose it when you want the text to flow and do not need to know where pages ended.

Why the page breaks look invisible

A form feed (Unicode U+000C) is a control character, not a letter. Printers used it to start a new sheet, and plain text files still use it as a page marker. Because it has no visible shape, editors handle it differently: some draw it as a symbol such as ^L or FF, some show a small box, and many show nothing at all.

Deckle writes each form feed on its own line, with a line break before and after it. In an editor that hides the character, a page boundary therefore looks like a blank line, which is easy to mistake for an ordinary gap between paragraphs.

So if the file looks like one long document with no markers, check in a different editor, or search for the character, before deciding the breaks are missing. Deckle always writes the form feed between pages when Mark where each page ended is chosen.

How to turn page breaks into visible labels

Most code editors and many text editors can search with regular expressions. Search for \f and replace it with a label you can see, for example \n--- next page ---\n. If your editor does not support \f, copy one form feed from the file into the search box.

To number the pages, a short script is quicker than doing it by hand. In most scripting languages, splitting the file on the form-feed character gives a list with one item per page, in the order you exported them.

Example: a 9-page meeting pack exported with page markers splits into 9 items. Item 4 is the fourth exported page; if you used All pages, that is page 4 of the PDF.

When page numbers in the text and the PDF differ

The form feeds mark exported pages, not printed page numbers. Two situations break the link:

  • You chose pages. With Choose pages and a list such as 5-8, 2, the first block in the file is page 5 and the last is page 2. Keep a note of the list you typed.
  • The printed numbers start later. A report with a cover and two contents pages prints "1" on PDF page 4. The fourth block in the file is that page.

For page-by-page work, how to extract text from specific PDF pages explains how the order you type becomes the order in the file.

Tips

  • Keep markers even if you plan to remove them. Deleting form feeds takes one search and replace. Putting them back means comparing the text with the PDF page by page.
  • Use a code editor to check. One that shows control characters makes the breaks obvious.
  • Check the markers before you paste into a word processor. A word processor may treat the character in its own way, so confirm the page count in a plain text editor first.
  • Check the count. Exported pages minus one equals the number of separators.

Frequently asked questions

Why can't I see page breaks in my extracted PDF text?

Your editor is hiding the form-feed character. Open the file in a code editor or search for \f to confirm the breaks are there.

Can Deckle add "Page 1", "Page 2" labels instead?

No. PDF to text writes a form feed or a blank line between pages. Replace the form feed with your own label after export.

Does a page break appear before the first page?

No. The separator only goes between pages, so the file starts with the first page's text and ends with the last page's text.

Do blank pages still get a separator?

Yes. A page with no text adds an empty block between two separators, so the count of pages still matches.

  • PDF to text to export text with a page marker between pages
  • Split PDF to make one PDF per page when you need the pages themselves
  • Organize PDF pages to fix the page order before extracting

Sources