An HTTP API & CLI utility for parsing ProfitStars & FIS PDF files into individual check images named by reference number.
- imagemagick
- Poppler/xpdf (pdftotext, pdfimages)
Run dart bin/server.dart
. By default, the HTTP server runs on 0.0.0.0:8080
. Set the ENV variables SHELF_HTTP_HOST
and SHELF_HTTP_PORT
to override.
POST http://localhost:8080/?provider=ps|fis HTTP/1.1
Content-Type: application/pdf
Content-Length: [NUMBER_OF_BYTES_IN_FILE]
[PDF_DATA]
Binary ZIP file contents is returned.
Usage: bin/cli.dart <command> [arguments]
Available commands:
directory
- Parse a directory of PDFs.file
- Parse a single PDF file.help
- Display help information for ppp-cli.
Usage: bin/cli.dart file [arguments]
-f, --file
- Path of the PDF file to parse.-p, --provider
- PDF Provider - "ps" or "fis".-c, --clear
- Clear output directory.-z, --zip
- Zip up output images.
Usage: bin/cli.dart directory [arguments]
-d, --directory
- Directory containing PDF files to parse.-p, --provider
- PDF Provider - "ps" or "fis".-c, --clear
- Clear output directory.-z, --zip
- Zip up output images.
- Install the Dark SDK: https://dart.dev/get-dart at version 1 & dependencies:
choco install dart-sdk --version 1.24.3 -y choco pin add -n=dart-sdk --version 1.24.3 choco install gcloudsdk imagemagick xpdf-utils -y
- Run local server:
dart bin/server.dart
- HTTP post using Postman or similar:
curl --location --request POST 'http://localhost:8080' \ --header 'Content-Type: application/pdf' \ --data-binary '@/path/to-file.pdf'
- Authenticate with Google Cloud:
gcloud auth login gcloud config set project dc-magento gcloud auth configure-docker
- Build, Tag, & Push Image
docker build -t dartmouthcapital/payment-pdf-parse . docker tag dartmouthcapital/payment-pdf-parse gcr.io/dc-magento/payment-pdf-parse docker push gcr.io/dc-magento/payment-pdf-parse
- Update remote container
ssh dc-service1 docker stop ppp docker container rm ppp # if auth has expired: docker-credential-gcr gcr-login docker-credential-gcr configure-docker docker pull gcr.io/dc-magento/payment-pdf-parse docker run --name ppp -itd -p 8090:8080 \ --log-driver=gcplogs \ --restart always \ gcr.io/dc-magento/payment-pdf-parse