CATweasel Toolkit v4.0.5

Consistent Commands, Meaningful Exit Codes and Custom Branding in the PDFParser

With version 4.0.5, the CATweasel Toolkit receives numerous improvements in integration into existing workflows, in configuration and in the reliability of the analysis results. This makes the toolkit even easier to control from scripts and other programs.

The focus is on consistent naming of the commands, exit codes following an established convention, custom branding for the result PDFs and a stable, reproducible sorting of terminals and devices.

Consistent Commands and Better Integration

Commands with the Prefix ctw-

The commands of the toolkit now start with ctw-. This avoids conflicts with commands of the same name from other programs. The PDFParser, for example, is called like this:

ctw-pdfparser schematic.pdf

The previous command pdfparser keeps working for now, but shows a deprecation notice and will be removed in a later version. Scripts that use it should therefore be updated. Shortcuts, the “Send to” menu and the “Open with” entry are updated automatically by the installer.

Exit Codes for Calling Programs

The applications now report what went wrong through their exit code. Calling programs and scripts can thus react specifically to the type of error instead of only distinguishing between “successful” and “failed”. The codes follow the common sysexits.h convention, for example:

  • 64 incorrect usage
  • 66 input file not found
  • 73 output file cannot be written
  • 78 configuration error
  • 130 cancelled by the user

The complete list can be found in the manual of each application (--man). The start scripts such as ctw-pdfparser.cmd and catweasel.cmd now also pass the exit code on to the caller; previously they always returned 0. In addition, error messages are now shown only once.

Selecting the Parser for a Single Run

The parser used by the PDFParser can be specified for a single run, for example when the PDFParser is started by another program. The parser selection is then not shown:

ctw-pdfparser --DefaultParser=SignedPageDeviceCounter schematic.pdf

Alternatively, the environment variable CATWEASEL_DefaultParser can be used. An unknown name is rejected with a list of the configured parsers.

Stricter Command-Line Checks

Options must now be written out in full. Abbreviations such as --log for --log-level are no longer accepted. The PDFParser expects exactly one PDF file. File names containing spaces must be enclosed in quotation marks when calling the program directly. Calling it via drag and drop or the “Send to” menu is not affected.

Custom Branding in the Result PDF

The PDFParser can place a watermark and a stamp on every page of the result PDF, for example your own company logo. Both are stored as PDF files:

  • var/custom/branding/watermark.pdf is scaled to the page size and displayed semi-transparently.
  • var/custom/branding/stamp.pdf keeps its size and is placed in a corner.

If the files exist, they are used automatically. Other files, the opacity and the corner of the stamp can be set in the new <Branding> block of pdfparser.cfg. The test version contains a watermark and a stamp with a QR code for requesting the full version. The installer of the full version removes them again; your own files are kept.

More Reliable Configuration

Relative Paths and Environment Variables

Relative paths in the configuration, for example for FilterConfig or a <Target> folder, now always refer to the installation directory, regardless of where the PDFParser is started from. In addition, environment variables can be used in paths:

<Target "$PUBLIC\Documents\CATweasel">

A missing filter file is reported as a configuration error with its full path.

Renamed and Additional Parsers

The preinstalled parsers are now named after what they detect. “Standardfilter IEC81346” becomes SignedPageDeviceCounter, and “Sonderfilter EXAMPLE” becomes PageDeviceCounter. The filter rules themselves remain unchanged. On update, the installer adapts the configuration and keeps the previous files as .old, so that your own adjustments can be transferred.

In addition, there is the new parser SignedDeviceCounter for device tags such as -K1 without a page number. The comments of the parser configurations have been revised, and all parameters are documented centrally in _example.cfg.tmpl.

Stable and Reproducible Sorting

Terminals that combine digits and letters, such as 1A, 11C or 24VDC, are now sorted naturally, for example 1A, 1B, 4A, 11A. Previously, their order could vary from run to run. The same schematic now always produces the same result.

In addition, PA and SH terminals are placed at the end of the terminal strip behind PE, as described in the manual. Devices without a number, such as -K, appear directly before the numbered devices with the same letters (-K, -K1, -K2) instead of in a separate block.

Bug Fixes

  • Before the analysis, the PDFParser checks whether the result PDF and the export files can be written. If a file is still open, for example in the PDF viewer or in Excel, it stops immediately and names the file, instead of failing only after the complete analysis.
  • Parsers with the same SortCriteria were missing from the parser selection. All parsers are now offered.
  • If only one parser is configured, it is used directly instead of causing an internal error.
  • Leaving the parser selection without a choice is now treated as cancellation by the user.
  • PDF files with an exclamation mark in their name are found again when passed via drag and drop or “Send to”.
  • Starting without a file, for example from the Start menu, no longer closes the window immediately but shows the error message.

Outlook

The applications now support subcommands with their own options and their own help. This structure forms the basis for the newly developed Lagerist module for managing material data and bills of materials, which will be presented in an upcoming version.

Summary

Version 4.0.5 makes the CATweasel Toolkit more robust and easier to integrate into existing workflows:

  • Consistent commands with the prefix ctw- avoid conflicts with other programs.
  • Meaningful exit codes allow calling programs to handle errors specifically.
  • Custom branding with watermark and stamp in the result PDF.
  • More reliable configuration thanks to consistent relative paths and environment variables.
  • Reproducible results thanks to stable sorting of terminals and devices.
  • Early error detection if result files are still open.

If you call pdfparser in your own scripts, you should switch to ctw-pdfparser and take the new exit codes into account.

CATweasel Toolkit v4.0.4

Improvements to Configuration, Command Line and CSV Export

Version 4.0.4 brings numerous improvements to the CATweasel Toolkit, particularly regarding the operation of the applications, integration into existing workflows and the output of analysis results. In addition to fixing a bug in the processing of configuration blocks, new command-line functions have been introduced that make version information available centrally and allow more flexible control of the applications.

Another focus is on clearer console output and a simplified configuration of the CSV export. This makes working with the toolkit more convenient, both for manual use and for automated use in scripts and other applications.

New Command-Line Functions

Central Version Query with catweasel

The new command-line application catweasel provides a central way to query the installed version of the CATweasel Toolkit and the versions of its installed modules.

Running

catweasel --version

outputs the toolkit version together with the versions of the installed modules, for example the PDFParser. The version information is set up when the toolkit is installed and is therefore available directly on the respective system.

In addition, the Start menu contains the new shortcut CATweasel VERSION. It opens a window with the version information that stays open until a key is pressed. This makes it easy to check the installed versions quickly without typing a command.

Controlling Applications via Command-Line Parameters

All applications of the CATweasel Toolkit now support the additional command-line options --SystemWait and --TempCleanup.

These options override the corresponding settings of the configuration file for a single program call, without having to change the configuration permanently. This is particularly helpful when applications are integrated into other programs, workflows or scripts.

An example for the PDFParser:

pdfparser.pl --SystemWait=false test.pdf

In this case, the PDFParser does not wait for a key press after processing. This makes automated processing of multiple files much easier, where manual confirmation after each run is undesirable.

Both options accept the values true and false. Alternatively, yes and no can be used. For --SystemWait, a waiting time in seconds can also be specified.

The new options thus offer more flexibility in controlling program behaviour, without the need for separate configuration files for different use cases.

Improved Feedback and Console Output

Countdown for Timed Program Exit

If a waiting time in seconds is set via the SystemWait setting, the application now displays a countdown with the remaining time.

Instead of a static message, you can see at any time how long the program will wait before the process is completed. This improves clarity during interactive use and makes the behaviour of the applications easier to follow.

Correct Handling of the Log Level Option

The processing of the --log-level option has also been improved.

Previously, the message about a change of the log level could appear twice. In addition, an invalid value was initially treated as if the log level had been changed, before it turned out that the value was not permitted.

Both issues have been fixed. Invalid log levels are now rejected immediately, and the valid values are listed. This makes incorrect command-line parameters quicker to spot and correct.

Tidier Console Output

The start and exit messages of the applications are now only output at the debug logging level.

This keeps the regular console output clearer and more focused on the information relevant to the respective processing run. If required, the more detailed messages can still be viewed via debug logging.

Bug Fix for Configuration Blocks

A bug in the processing of the short notation for configuration blocks has been fixed.

Affected were, among others, constructs such as:

<Target "C:\Path" />

Depending on the notation, remaining spaces or quotation marks could prevent the name of the configuration block from being cleaned up correctly. As a result, a target folder specified for the CSV export, for example, could be unusable.

Block names are now cleaned up regardless of the notation used for a configuration block. The names are thus processed consistently, and the resulting paths can be used reliably.

Simplified Default Configuration for the CSV Export

The default configurations for the CSV export have also been improved. Both CSV export configurations now contain the following target path by default:

C:\Users\Public\Documents\CATweasel

This provides a defined directory for CSV reports in which analysis results can be saved directly.

For PDF analysis in particular, there is no longer any need to configure the export target manually first. This simplifies commissioning and makes it easier to use the CSV export in existing workflows.

Summary

Version 4.0.4 improves several areas of the CATweasel Toolkit, from configuration processing and command-line control to the output of analysis results.

The most important changes at a glance:

  • New version query: The command catweasel --version shows the version of the toolkit and the versions of the installed modules.
  • More control over program calls: --SystemWait and --TempCleanup override configuration settings for individual calls.
  • Improved usability: A countdown shows the remaining waiting time.
  • More reliable configuration: Configuration block names are cleaned up correctly regardless of their notation.
  • Clearer console output: Start and exit messages are only shown in debug mode.
  • Simpler CSV export: A default target path is now available in both CSV export configurations.

These changes make the CATweasel Toolkit more robust and more flexible. The new command-line options and the central version query in particular make it easier to integrate and manage the applications, while the fixes and default configurations ensure a more reliable and convenient workflow.

CATweasel Toolkit v4.0.3

Version 4.0.3 brings further improvements to the CATweasel Toolkit in several areas. This time, the focus is on a clearer presentation of the PDF results, a more convenient Windows installer and support for development and test versions.

Improved Presentation of PDF Results

The PDFParser now draws the recognised elements in the result PDF in a fixed order. This ensures that the individual elements remain correctly visible, regardless of the order in which they were recognised.

The merged connection area of a device is shown in the background, individual connections above it and, finally, the device tags in the foreground. Previously, the merged connection area could partially cover other recognition results.

This does not change the recognition itself or the configuration settings. Only the presentation of the generated result PDF has been improved.

Windows Installer Improvements

The CATweasel uninstaller is now correctly registered in the Windows list of installed applications. It is also available directly from the CATweasel folder in the Start menu.

For test and presentation versions, a shortcut to the supplied sample files is also available. For such development builds, it is selected for installation by default. Regular release versions can also create the shortcut; there it can optionally be selected during installation.

New Agreement for Test and Presentation Versions

A new test and presentation agreement is introduced with the development builds. This allows current development versions from the dev branch to be provided, for example, for testing or presentations.

These so-called nightly builds are designed for a period of up to four weeks and are expressly provided as development versions without warranty, support or security updates. Feedback and bug reports are of course welcome, but do not create any entitlement to processing or bug fixes.

Adjusted Licensing of Development Builds

Development builds are no longer distributed under the ASL. Instead, for these versions the installer points out the applicable terms for test and development builds and installs the corresponding notice.

Regular releases are not affected by this.

Standardised Licence Notices

The licence notices in the source code have been standardised. They now consistently refer to the LICENSE file, which is part of every distribution. This avoids having to maintain different or outdated licence texts within the source code.

Conclusion

Version 4.0.3 primarily rounds off existing functions and workflows. The improvements range from a more reliable presentation of the PDF results and a more convenient Windows installer to clearly defined conditions for development and test versions.

CATweasel Toolkit v4.0.2

With version 4.0.2, filter processing in the CATweasel Toolkit becomes fundamentally more flexible. The previously hard-coded filter configuration has been replaced by the new CATweasel filter definitions.

This creates a much better basis for more complex filter rules and future extensions of the recognition.

New Filter Architecture

The filter modules used so far have been replaced by a new filter architecture. Instead of the previous ECAD::PDF::Filter::* modules, the corresponding CTW::PDF::Filter::* modules are now used.

This is not merely a renaming. The new structure is a technical evolution of filter processing and lays the groundwork for more powerful filter definitions in the future.

For compatibility reasons, the old module names are still accepted for the time being. However, their use is logged as a warning and is intended only as a transitional solution. Existing configurations should therefore be switched to the new CTW module names.

Simpler Filter Configuration

As of this version, specifying a filter is optional.

If no filter is specified explicitly, the PDFParser automatically selects the appropriate default configuration: if a custom FilterConfig exists, the custom filter is used. Otherwise, the default filter applies.

If a filter is specified explicitly, this setting still takes precedence.

This keeps simple configurations more compact, while full control over filter processing remains available for more complex applications.

Updated Examples and Documentation

The new filter architecture is also reflected in the documentation and in the example configurations supplied. The examples are therefore fully in line with the current technical structure.

For existing installations in particular, we recommend taking a look at the updated documentation in order to convert older filter definitions to the new structure.

Adjusted XLSX Export

In the XLSX export, the worksheet previously named BMK has been renamed to Devices.

The new name matches the naming of the corresponding configuration options and ensures more consistent terminology within the export.

Technical Clean-up

In addition to the functional changes, various binary files and parts of the distribution have been cleaned up. This has reduced both the size and the complexity of the distribution.

This work also helps keep the technical basis of the CATweasel Toolkit clearer and easier to maintain.

Updated Licence

Version 4.0.2 also updates the licence to ASL 1.1.

The new version sets out the conditions for use in container and hosting environments more clearly and takes into account access to the source code under maintenance agreements.

Also New: Changelog

With this version, a central CHANGELOG.md becomes part of the distribution for the first time. Changes and new features will be documented per version from now on and can be followed independently of the detailed technical documentation.

Version 4.0.2 thus lays the foundation, especially in filter processing, for further functional extensions and a more flexible configuration of the PDFParser.

CATweasel Toolkit v4.0.1

Version 4.0.1 further expands the technical basis introduced with version 4.0. The focus is on the export functions of the PDFParser, Windows integration and a further revision of the documentation and configuration.

New CSV Export

One of the most important new features is the reworked implementation of the CSV export.

The CSV export now offers configuration options modelled on the existing options of the XLSX export. In addition, CSV-specific settings are available.

This makes it much easier to tailor the generated CSV files to the requirements of downstream processing.

Improved Handling of PDF Attachments

The processing of embedded PDF files has been improved. A bug that occurred when generating multiple exports, which meant that PDF attachments were not always handled correctly, has been fixed.

Combining multiple exports with embedded files is therefore more reliable.

Improved Management of Temporary Files

The handling of temporary files has also been revised. Temporary files are now created, used and cleaned up in a more controlled manner.

This improves reliability, especially for more complex export operations, and reduces the number of temporary files left behind unnecessarily.

Better Windows Integration

On Windows, the PDFParser is now registered for “Open with…”. PDF files can therefore be opened with the PDFParser directly via the Windows file association.

This allows the PDFParser to fit more naturally into the familiar way of working on Windows.

Revised Configuration and Documentation

The configuration options of the PDFParser have been further extended and documented accordingly. This includes settings for the parser, the exports and logging.

At the same time, the technical documentation has been substantially extended and revised. In addition to configuration, aspects of security and cyber resilience are now described in more detail.

Further Improvements

Various issues in the installer and setup have also been fixed. The build process has been improved and cleaned up in several places.

Version 4.0.1 thus further develops the export functions and the integration into the Windows environment, adding numerous practical improvements to the extensive technical foundation of version 4.0.

CATweasel Toolkit v4.0.0

With version 4.0.0, the CATweasel Toolkit receives a comprehensive technical overhaul. In addition to a new foundation for PDF processing, installation and deployment of the system have been simplified considerably.

The new version thus provides a more compact and more maintainable basis for the further development of the CATweasel Toolkit.

Simpler Installation and Fewer Dependencies

A key focus of the new version is the reduction of external dependencies. Components with restrictive licence terms have been removed from the distribution. In particular, PDF processing no longer requires a separate installation of pdftk Server or Ghostscript.

The tasks previously handled by these components are now performed by qpdf and by native functions of the PDFParser. The required components are supplied with the Windows distribution.

This makes installation much clearer, and the CATweasel Toolkit can be set up and operated on target systems more easily.

New Installer and Revised Deployment

The Windows installer has also been fundamentally revised and adapted to the new build and release process.

The additional installation steps previously required for PDF processing are no longer necessary. At the same time, the installation documentation has been adapted to the new structure, so that installation and configuration are now clearly separated.

New Configuration Structure

The configuration of the CATweasel Toolkit has been restructured. In particular, the settings for the PDFParser and for the exports are now clearly separated.

In addition, new configuration options have been introduced for logging, the handling of temporary files and export processing. This allows the PDFParser workflows to be better adapted to different use cases.

Significantly Extended Documentation

Version 4.0.0 also significantly extends the technical documentation.

Besides detailed documentation on configuring the PDFParser, the new documentation covers, among other things:

  • technical fundamentals of PDF processing,
  • filter definitions and their configuration,
  • relevant standards for texts and designations in circuit diagrams,
  • security and cyber resilience,
  • installation and deployment of the CATweasel Toolkit.

Alongside the software itself, there is now a much more comprehensive basis for its configuration and operation.

Further Technical Improvements

In addition to the major changes, version 4.0.0 contains numerous smaller improvements to the build system, the installer, configuration handling and PDF processing.

This version therefore forms the technical foundation for the further development of the CATweasel Toolkit and creates a much clearer structure, especially for installation, configuration and maintenance.

CATweasel Toolkit v3.0.2

I am pleased to announce that version 3.0.2 of our CATweasel Toolkit is now available.

In this release, we focused primarily on further strengthening our new structure. We therefore made several changes to the file structure and fixed links that were no longer working after the restructuring.

We have deliberately chosen not to include any new features in this release. New features are already in development and will be available in the upcoming update.

As usual, the updated Toolkit is ready for you in the Downloads section.

Switch from PDFParser to the Toolkit

Since version 3.0.0 of our CATweasel Toolkit, PDFParser has been included as part of the Toolkit and now offers a wide range of new features. If you wish to switch to the CATweasel Toolkit while retaining your settings and custom filters, you will need to be familiar with the new data structure.

We have made a number of improvements to simplify user configuration. For example, all configuration files have been moved from the subdirectories (perl/site/bin) to the top-level etc directory. This provides a clearer separation between the actual program data and the configuration files. This structure makes it easier to maintain an overview, particularly in more complex and distributed configurations.

Before switching to the CATweasel Toolkit, you should make a backup copy of the file perl\site\bin\pdfparser.cfg. The contents of this file may later need to be incorporated into several configuration files in the new structure.

After that, we recommend completely uninstalling all CATweasel tools and manually deleting any leftover files from the installation directory. To do this, delete the entire CATweasel folder after uninstalling the tools. This prevents obsolete settings or libraries that may remain in the file system from causing problems during the Toolkit installation.

The settings for the parser itself are still stored in the pdfparser.cfg file within the new structure. You can transfer your previous settings here.

In the simplest case, without any customizations, you can simply take your existing pdfparser.cfg file and use it to overwrite the installed file in the `etc` folder.

As global settings such as logging are now managed in the central configuration file catweasel.cfg, this section should be removed from the old PDFParser configuration file pdfparser.cfg.

I hope this information helps you transition to our new CATweasel Toolkit and that you enjoy using it.

Cheers, Niklas

P.S.: Please also note that the configuration level for the parser has changed. The additional <ParserList> level has been removed from the configuration!

Another important note for anyone wishing to migrate an existing PDFParser profile to the new Toolkit: the <ParserList> level has been removed from the configuration structure. Parsers are now created directly at the <PDFParser> level. For existing configurations, this means that the parsers must be moved up one level.

See also the comment: https://alx-development.de/?p=397#comment-3

CATweasel Toolkit v3.0.0

CATweasel Toolkit Version 3.0.0 Released

Following an intensive development phase, we are delighted to present the first version of our new CATweasel Toolkit. Version 3.0.0 marks the start of a new era for our software family dedicated to data processing in control panel manufacturing.

The version number 3.0.0 has been chosen deliberately: all previous CATweasel tools were available up to version 2 at most. With this Toolkit, we are bringing the previously separate applications together on a single platform, creating a clear distinction from the older standalone solutions from the start.

Everything brought together in one Toolkit

The CATweasel Toolkit brings together all existing tools under a single, unified interface for the first time. The current version includes the following modules:

  • PDFParser – for extracting, analyzing, and filtering PDF documents
  • Lagerist – for managing bills of materials, items, and logistics processes
  • Terminal – the powerful command-line environment with numerous useful features

This means that, for the first time, a central platform is available that makes workflows in control panel manufacturing more efficient and consistent. Individual components no longer need to be installed and updated separately – everything is integrated into the Toolkit.

Older standalone versions are being phased out

The individual versions of the tools released to date will remain available in the Downloads section for the time being, but will no longer be developed further. All future enhancements and improvements will be made exclusively within the CATweasel Toolkit.

Please note: It is not possible to simply update from the individual versions to the Toolkit. The old programs must first be completely uninstalled before the Toolkit can be installed.

Existing configurations and filter definitions (e.g. from the PDFParser) will continue to work and can continue to be used in the new environment.

Discontinuation of older versions

The individual versions released to date will be fully phased out over time once security-related updates become necessary. These older versions will then be removed from the Downloads section, as all future maintenance and development will be carried out exclusively for the Toolkit.

We therefore recommend that all users switch to the new CATweasel Toolkit 3.0.0 as early as possible so that they can continue to benefit from all improvements and security updates in the future.

Looking ahead

With this Toolkit, we are laying the foundation for the future development of the CATweasel platform. Our plans include new interfaces, improved automation features, and closer integration between the modules.

We would like to thank everyone who has provided feedback and supported the development process over the past few months. The CATweasel Toolkit represents a major step toward a modern, unified, and privacy-friendly software foundation—and provides the basis for many more exciting features in the future.

Download: The new CATweasel Toolkit 3.0.0 is now available in the Downloads section.