﻿Image2PDF - packer plugin for Total Commander
Version 2.1.0 (2026-10-31)

Copyright (C) 2026 Andrei Piasetski
License: GNU General Public License, version 3 or later (see LICENSE.txt)
Source code: https://github.com/apiasetski/Image2PDF


WHAT IT DOES
------------
Packs the image files selected in Total Commander into one PDF file,
one image per page. Select the images, press Alt+F5 (Pack files),
choose "pdf" as the packer and press OK.

 * JPEG images are embedded byte for byte: no recompression, no quality loss.
 * PNG images are embedded losslessly, including transparency (alpha channel).
 * BMP, GIF, TIFF (every page), WebP, HEIC, AVIF and other formats Windows
   can open are converted too.
 * Pages follow the natural name order (img2 before img10), also across
   selected subfolders; or the panel order, file date or date taken.
 * Page sizes A3, A4, A5, Letter, Legal or your own, with fit or fill.
 * Bookmarks for folders and files; title and author in the PDF.
 * Optional file size reduction for scans and phone photos.
 * Optional text recognition (OCR) with the engine built into Windows 10
   and 11: an invisible text layer makes the PDF searchable.
 * Photos are turned upright using their EXIF orientation (can be switched off).
 * Files that are not images are skipped.
 * English and Russian interface; 32-bit and 64-bit Total Commander;
   no external libraries.

It also works the other way round: Ctrl+PgDn on any PDF file lists the
images inside it like the files of an archive, and F5 copies them out,
JPEG images byte for byte (see OPENING A PDF below).


INSTALLATION
------------
Open the plugin archive in Total Commander (Enter on the zip file) and
confirm the installation prompt. Total Commander copies the plugin and
associates the "pdf" extension with it.

The plugin is registered as "hidden": Enter on an ordinary .pdf file still
opens your PDF viewer, and Ctrl+PgDn opens it in the plugin.

Updating: install the new archive the same way. Your settings are kept.


SETTINGS
--------
In the Pack files dialog (Alt+F5) choose "pdf" and click "Configure".

Page
 * Page size         - Original image size: every page is exactly as large
                       as its image. A3, A4, A5, Letter, Legal or Custom
                       (width x height in mm): the image is placed inside
                       the margin.
 * Resolution        - how many pixels make an inch, for "Original image
                       size" and for "Never enlarge small images".
 * Margin            - paper margin in millimetres.
 * Placement         - Fit inside the page: the whole image is visible.
                       Fill the page: the image covers the area inside the
                       margin and the overhanging part is cut off.
 * Alignment         - Centre, or Top (the free space goes to the bottom).
 * Always portrait   - every page keeps the portrait orientation. When not
                       ticked, the page turns for wide images.
 * Never enlarge small images - small images keep their size (at the
                       resolution above) instead of being scaled up.
 * Turn photos upright (EXIF).

Document
 * Page order        - Natural name order (img2 before img10); As sorted in
                       the panel; File date; or Date taken (EXIF, falling
                       back to the file date). The date orders sort within
                       each folder.
 * Bookmarks         - None; One per folder (each selected subfolder);
                       One per file; or Folders and files (files nested in
                       their folders).
 * Author            - written into the PDF. The title is the PDF's file
                       name.

File size (off by default, so nothing is recompressed unless you ask)
 * Reduce file size  - images drawn at a higher resolution than "Max.
                       resolution" are scaled down to it (measured at the
                       size they have on the page, so it matters most for
                       A4 and the other paper sizes). Photos are stored as
                       JPEG with the given quality; PNG, BMP, TIFF stay
                       lossless. Images that are already small enough and
                       need no colour change are left exactly as they are.
 * Colours           - Keep, Grayscale, or Black and white (1 bit per pixel,
                       a plain 50% threshold: good for text, not for photos).

Text recognition (off by default)
 * Make the PDF searchable (OCR) - recognises the text of every page with
                       the OCR engine built into Windows 10 and 11 and
                       puts it on the page as an invisible layer, exactly
                       over the words on the image. PDF viewers can then
                       search the document and copy its text. The images
                       themselves are not changed. About half a second
                       per page.
 * Text language     - Windows languages: every language that has text
                       recognition installed in Windows (for example
                       English and Russian); each page gets the one that
                       fits. Or choose one language.
   Recognition comes with the Windows display languages. To add one, open
   Windows Settings > Time & language > Language, add the language, and
   in its options install "Optical character recognition". If the chosen
   language is missing, the plugin asks whether to pack without text.

Language: Automatic follows the Total Commander language (Russian if a
Russian language file is selected, otherwise English), or choose English
or Russian.

The settings are saved in image2pdf.ini in the plugin folder and apply to
every following pack.

Progress: the Total Commander progress window advances per page, also
inside multi-page TIFF files, and Cancel stops at the next page; nothing is
written in that case.


SUPPORTED IMAGES
----------------
Embedded as they are, without any conversion:
 * JPEG: baseline and progressive; grayscale, RGB and CMYK.
 * PNG: grayscale, RGB and palette images, all bit depths, with or without
   alpha channel (not interlaced).

Converted with the Windows Imaging Component (part of Windows):
 * BMP, GIF (first frame), ICO, TIFF (every page becomes a PDF page),
   interlaced PNG and the rarer JPEG variants - stored losslessly;
   black-and-white scans stay 1-bit.
 * WebP, HEIC, AVIF, JPEG XR and camera RAW - stored as JPEG (quality 90),
   since these formats are lossy already.
 * Transparency is kept.
 HEIC needs the "HEIF Image Extensions" and "HEVC Video Extensions" from the
 Microsoft Store, AVIF the "AV1 Video Extension", WebP on older Windows 10
 the "Webp Image Extensions". If a codec is missing, packing stops with a
 message naming the file.

Ignored: PNG palette transparency (tRNS), colour profiles and gamma.


OPENING A PDF (EXTRACTING IMAGES)
---------------------------------
Select a PDF file and press Ctrl+PgDn: Total Commander lists the images
inside it like the files of an archive. Copy them out with F5, view one
with F3, or unpack all with Alt+F9. Enter still opens your PDF viewer.

 * Works with any PDF, not only those made by Image2PDF.
 * JPEG images are extracted byte for byte, exactly as they were stored in
   the PDF; for a scanned PDF these are usually the original scans.
 * JPEG 2000 images are saved unchanged too, as .jp2 (or .j2k).
 * Black-and-white scans with fax compression (CCITT Group 4) are saved as
   TIFF with their original data; the other fax variants are decoded and
   saved as PNG.
 * All other images (Flate, LZW, RunLength or uncompressed; grayscale, RGB,
   CMYK, palette, 1 to 16 bits) are saved as lossless PNG. Transparency
   (soft masks) is kept; CMYK is converted to RGB.
 * Names: "Page 001.jpg", or "Page 001-1.jpg", "Page 001-2.png" when a page
   holds several images. An image used on several pages is listed once, at
   its first page.
 * The hidden text layer of a searchable PDF (made by Image2PDF or another
   OCR program) is listed as "Text.txt": the recognised text of every
   page, in UTF-8.
 * Images are found in the page resources and in the forms the pages use.
   Soft masks are merged into their image, not listed separately.
 * Encrypted PDFs that open without a password (with only "permissions"
   restrictions) are read: RC4, AES-128 and AES-256. PDFs that ask for a
   password to open are not.
 * Damaged PDFs (wrong cross-reference table, cut-off files) are repaired as
   far as possible.
 * Sizes in the list are exact for JPEG and JPEG 2000 and estimated for the
   other formats.

Not extracted: JBIG2 images (no common file format can hold them), inline
images (small images stored inside the page content) and images used only
in annotations or patterns.


LIMITATIONS
-----------
 * Pages cannot be added to an existing PDF. Packing onto a file name that
   already exists stops with a message; the existing file is not changed.
 * Text recognition needs Windows 10 or later. It reads printed text;
   handwriting and very small or blurred print are recognised poorly.
 * Images larger than 2 GB are not supported. When extracting, each decoded
   image must be under 1 GB, and very large PDFs (more than about 1 GB) may
   not open in 32-bit Total Commander.


VERSION HISTORY
---------------
2.1.0 Text recognition (OCR) with the engine built into Windows: an
     invisible text layer makes the PDF searchable. Ctrl+PgDn on a
     searchable PDF also lists its text layer as Text.txt.
2.0.0 Opens PDF files like an archive: Ctrl+PgDn on any PDF lists the
     images inside it and F5 extracts them - JPEG and JPEG 2000 byte for
     byte, CCITT fax scans as TIFF, everything else as PNG. Reads object
     streams, encrypted PDFs that open without a password (RC4, AES-128,
     AES-256) and repairs damaged files.
1.6  Page sizes A3, A5, Legal and custom; fill (crop), top alignment and
     "Never enlarge small images". Bookmarks for folders and files. Title
     and author. Optional file size reduction (resolution, JPEG quality,
     grayscale, black and white). Page order by panel, file date or date
     taken. Russian interface. Progress and Cancel inside multi-page TIFFs.
1.5  BMP, GIF, TIFF (multi-page), WebP, HEIC, AVIF and more, through the
     Windows Imaging Component. Interlaced PNG is supported now.
1.4  First public release under the GNU GPL. The package no longer contains
     a settings file, so updating keeps your settings.
1.3  Clear message when none of the selected files is a JPEG or PNG image.
1.2  Clear message when the target PDF already exists.
1.1  Settings window; "Always portrait" option for A4 and Letter.
1.0  First version.


LICENSE
-------
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.

This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
more details (LICENSE.txt).
