I wanted to convert some Postbank PDFs to CSV and found Postbank_PDF2CSV which is based on command line utils and bash-script-based parsing.
I wanted to try it out with Cygwin under Windows since I had no other Linux at hand and was quite positive it would work.
It did not work right away and greeted me with:
$ ./postbank_pdf2csv_bis_2023-02.sh -?
Dieses Skript funktioniert nur mit FreeBSD, Linux or Macos.
I tried to remove the overjealous restriction, installed some required libs, fixed some script bug (that exited the script before CSV generation and echoing hallo) but could not make it work getting errors like:
GPL Ghostscript 10.01.2: Unrecoverable error, exit code 1
Although I have a github account I could not file an issue or get in contact at the project itself.
Finally I could make it work and I want to share important steps that should help to get it done or make it into the scripts and wiki of the project:
install Cygwin and add
wgetcommand in the process to download some package managerdownload and install
apt-cygfor easier tool install without usingsetup.exe:make the internal script-os-check in
postbank_pdf2csv*.shrun under Cygwin by adding some code here:if [ "$(uname -o)" = "FreeBSD" ] || [ "$(uname -o)" = "Darwin" ] ; thenif [ "$(uname -o)" = "FreeBSD" ] || [ "$(uname -o)" = "Darwin" ] || [ "$(uname -o)" = "Cygwin" ] ; thenin some history version scripts there is some test code that causes some early
exitof the script which can be fixed by outcommenting (#) those lines, e.g.:README.mdsays to install some required tools and we do it like this:$ apt-cyg install ghostscript poppler pstotextdifferent errors arise because of still missing libraries so in summary I fixed it like this:
the typical error is
C:/cygwin64/bin/pdftotext.exe: error while loading shared libraries: ?: cannot open shared object file: No such file or directoryto determine the missing libraries you could check iteratively the missing ones running
cygcheckon it, e.g.:$ cygcheck /usr/bin/pdftotext.exewhich may result in e.g.:$ apt-cyg install libpoppler106 libfontconfig1 libfreetype6 libjpeg8 liblcms2_2 libnspr4 libnss3 libopenjp2_7 libpng16 libtiff6 libdeflate0 libjbig2 libwebp7 libexpat1 libgs10 libX11_6 libXt6 libpaper1 libtiff7 libxcb1 libICE6 libSM6 libXau6 libXdmcp6 libiconvif you get the above error
GPL Ghostscript 10.01.2: Unrecoverable error, exit code 1I fixed it by moving my PDFs to some local drive (C:) while it was a mapped remote one before (network share)