Use the source code migration script for the PDF Toolbox SDK
You can use the PDF Toolbox SDK Python script (3hto4h.py
) to automate the major part of source code migration from the 3-Heights® PDF Toolbox API to the PDF Toolbox SDK.
Python 3.4 or later is required.
- Back up your source code, if necessary.
- Execute the script, where
‹dir›
is the root directory of your source tree:
python 3hto4h.py ‹dir›
- The script iterates through files contained in the given directory and all its subdirectories (recursively), and processes the following file types:
- *.c, *.cpp, *.cxx
- *.h, *.hpp, *.hxx
- *.java
- *.cs
Each matching file is processed in-place. The processing consists solely of regular expression substitutions, which fall into two categories:
- Source code replacement
- Marking of code that needs attention by appending a trailing comment:
... //TODO 3H->4H: ‹message›
- You can switch off the code marking by executing the script with the
-m
option:
python 3hto4h.py -m ‹dir›
The substitutions done in this script do not completely migrate all source code. Compiler errors indicate code that needs manual migration.
In some situations, the script can falsely replace code that has no connection to the 3-Heights® PDF Toolbox API. Such changes must be undone.
The //TODO 3H->4H
markers help to locate code that could not be migrated completely or behavioral changes that need manual implementation.