Skip to content
HTKapp
Browse the documentation

Extract module: exporting pages into a new file

The Extract module creates one or more new PDF files from a selection of pages of the current document. Like Split, this is an export operation: the open document is not modified, only the generated files are written to disk. The tool is available from the Organization category of the Dashboard.

Choosing the pages to extract

The Pages to extract section offers three selection modes:

Selected pages

Only the pages ticked in the preview grid to the left of the module are extracted. An indication "X page(s) selected" is shown under the selector; as long as no page is ticked, the message "No page selected" appears in red and the Extract button stays disabled.

Tip: if you click thumbnails while another mode is active, HtkPDF automatically switches to "Selected pages" to reflect your intent.

All pages

Every page of the document is extracted. This is typically the mode to use to produce a copy of the document broken into individual files.

Custom interval

A Pages (e.g. 1, 3-5) field lets you enter a list of numbers and/or ranges, separated by commas. Valid examples:

  • 1, 3, 5: pages 1, 3 and 5;
  • 1-10: pages 1 to 10 inclusive;
  • 1, 5-7, 12: a combination of individual pages and ranges.

Numbers outside the document bounds are ignored. If the string entered contains no valid page, the Extract button stays disabled.

Choosing the output format

The Output format section determines how the extracted pages are grouped:

A single PDF file

All the selected pages are gathered into a single new document, in ascending order of their original number. Clicking Extract opens a standard macOS save panel to choose the location and the file name (proposed by default: <original_name>_extracted.pdf).

Separate files

The selected pages are written into several PDF files. A Pages per file field appears:

  • enter an integer ≥ 1 to group the pages into batches;
  • the value 1 (default) produces one file per page;
  • a value of 2 gathers pages two by two, and so on;
  • if the value entered is not a valid positive integer, an error message is shown and extraction stays disabled.

In this mode, the Extract button opens a folder picker: HtkPDF places each file there using the following naming convention:

  • for a single-page file: <original_name>_page_NNN.pdf;
  • for a multi-page file: <original_name>_pages_NNN-MMM.pdf.

Numbers are always padded to three digits to make alphabetical sorting in the Finder easier.

Running the extraction

The Extract button triggers an "Export operation" dialog reminding you that extraction is a direct export with no effect on the open document. Confirm with I understand to open the destination panel. The folder proposed by default is the one configured in Settings > Files.

While processing, the button reads "Extracting…" and stays disabled to avoid a double click. If writing some files fails (permissions, disk space), a message states the number of files in error.

A successful extraction closes the module automatically and hands control back to the Dashboard. The current document stays exactly in the state it was in before the operation.

Each produced file carries the document metadata (title, author…) and the part of the outline that concerns its pages, renumbered: an entry whose page is not extracted is dropped, and its sub-entries move up one level.

Note: to copy pages from another PDF into your current document (rather than the other way round), use the Merge module from the Dashboard. Extraction only works in the "current document → external files" direction.

Screenshots

1 screenshot — click to enlarge