Skip to content

Releases

2.2.0: hyphenation and ligatures

Choose a tag to compare

@ottosmops ottosmops released this 22 Nov 13:16

Adds optional text clean-ups; the output of text() does not change unless they are switched on. Includes the security fix of 2.1.0.

Added

  • TextCleaner::joinHyphenation() and Extract::joinHyphenation(): join words hyphenated at the end of a line («Familien-↵anlass» → «Familienanlass»; before an upper-case letter the hyphen stays, digits, blank lines and page breaks are left alone) and remove soft hyphens. Knows the plain and the Unicode hyphen, the Fraktur double hyphen «⸗» and «¬».
  • TextCleaner::expandLigatures() and Extract::expandLigatures(): replace the ligatures U+FB00–U+FB06 (ff fi fl ffi ffl ſt st) with their letters.
  • Both are off by default; the output of text() does not change unless they are switched on.

2.1.0: no shell, configurable timeout

Choose a tag to compare

@ottosmops ottosmops released this 22 Nov 13:16

Keeps the 2.0 API. Requires PHP >= 8.1 and symfony/process ^5.4 || ^6.4 || ^7.0 || ^8.0; Composer keeps older installations on 2.0.1. See Upgrading from 2.0.

Security

  • pdftotext is run with a list of arguments instead of a shell command. In 2.0 the file name was put in single quotes, so a name containing ' broke the command and allowed command injection.

Added

  • Options as an array, one argument per entry; addOptions() appends.
  • Fluent settings: layout(), raw(), encoding(), eol(), firstPage(), lastPage(), pages(), page(), password(), ownerPassword().
  • timeout(): configurable timeout (default 60 seconds as before, null for none); a timeout throws ProcessTimedOut, which extends Symfony's ProcessTimedOutException.
  • sanitizeUtf8(): replace invalid UTF-8 with U+FFFD.
  • command(): the command as a list of arguments.
  • Extract::findExecutable() and Extract::normalizeOptions().
  • PdftotextException interface, implemented by all exceptions; InvalidOption for invalid settings.
  • CouldNotExtractText::getErrorTail().

Changed

  • Requires PHP >= 8.1 and symfony/process ^5.4 || ^6.4 || ^7.0 || ^8.0. Composer keeps older installations on 2.0.1.
  • Option strings are still accepted; they are split like a shell would split them (quotes, backslashes), but no shell runs them.
  • The executable is found with Symfony's ExecutableFinder (PATH, then common directories) instead of which/type -P in a shell. A path is checked as given.
  • Exception messages name the file, the exit code and the last lines of stderr instead of the command line and the full output, so passwords do not end up in logs. BinaryNotFound and CouldNotExtractText still extend ProcessFailedException.
  • pdf() throws FileNotFound for a directory, too.
  • A relative path starting with - is passed as ./-…, so it is not read as an option.
  • The protected property $options holds an array.
  • CI on GitHub Actions for PHP 8.1 to 8.5; Travis CI removed. Tests and CI files are no longer part of the dist archive.

2.0.1

Choose a tag to compare

@ottosmops ottosmops released this 22 Nov 13:16

Security: 2.0.1 and earlier are affected by command injection through a file name containing '. Upgrade to 2.1.0 or later.

  • Remove PHP 5.6 reference from docs
  • Add GitHub Actions workflow for CI and code coverage
  • Add codecov badge to README
  • Improve documentation and security notes
  • Minor Markdown and PHPDoc improvements
  • PHPUnit 12 compatibility (test methods, config, autoloading)
  • Test setup and config modernized (phpunit.xml, composer, coverage)

Version 2.0.0

Choose a tag to compare

@ottosmops ottosmops released this 24 Jul 12:02

php >= 7.2
symfony/process >=4.2
phpunit >=8.2

Set the upper version for symphony processor to 4.1.

Choose a tag to compare

@ottosmops ottosmops released this 24 Jul 10:10
2145403
Merge pull request #2 from ceckobecko/improvement/limit-symphony-version

Set the upper version for symphony processor to 4.1.*

composer.js update

Choose a tag to compare

@ottosmops ottosmops released this 20 Apr 15:16
4f24aa0
v1.0.1

Version 1.0.1

version 1.0.0

Choose a tag to compare

@ottosmops ottosmops released this 09 Nov 16:22

First release