{"id":13573821,"url":"https://github.com/inetsys/pdftk-aws-lambda","last_synced_at":"2026-01-22T09:03:09.752Z","repository":{"id":46370025,"uuid":"169550236","full_name":"inetsys/pdftk-aws-lambda","owner":"inetsys","description":"AWS Lambda Layer with PDFtk","archived":false,"fork":false,"pushed_at":"2021-10-19T15:21:34.000Z","size":12885,"stargazers_count":22,"open_issues_count":1,"forks_count":6,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-05T08:37:12.534Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Makefile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/inetsys.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-02-07T09:54:49.000Z","updated_at":"2024-04-08T18:17:48.000Z","dependencies_parsed_at":"2022-09-22T23:30:31.183Z","dependency_job_id":null,"html_url":"https://github.com/inetsys/pdftk-aws-lambda","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inetsys%2Fpdftk-aws-lambda","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inetsys%2Fpdftk-aws-lambda/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inetsys%2Fpdftk-aws-lambda/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inetsys%2Fpdftk-aws-lambda/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/inetsys","download_url":"https://codeload.github.com/inetsys/pdftk-aws-lambda/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247179910,"owners_count":20897117,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T15:00:41.730Z","updated_at":"2026-01-22T09:03:09.721Z","avatar_url":"https://github.com/inetsys.png","language":"Makefile","readme":"# PDFtk\n\n[PDFtk Server](https://www.pdflabs.com/tools/pdftk-server/) is a command-line tool for working with PDFs.\n\nThis project shows how to compile and deploy the `pdftk` binary as an AWS Lambda Layer, as well as a built version for the binaries ready to use.\n\nCurrently the included binaries under `bin` and `lib` were built for the **PDFtk 2.02** version.\n\n# AWS Lambda Layer\n\n[Lambda Layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html) is a new convenient way to manage common dependencies between different Lambda Functions.\n\nThe following command will create a well-structured layer of this package:\n\n```cmd\ngit clone https://github.com/inetsys/pdftk-aws-lambda.git\ncd pdftk-aws-lambda\nmake\n```\n\nThe resulting ZIP file `pdftk-aws-lambda.zip` can be uploaded to the AWS Lambda Layers console.\n\n## Build binary\n\nIn order to compile the `pdftk` binary, the following steps were followed:\n\n1. Start an EC2 instance with CentOS 6. Amazon Linux is not suitable as it has not the _gcj_ compiler ([see AWS Forum post](https://forums.aws.amazon.com/thread.jspa?threadID=96919))\n2. Install some devtools, download the PDFtk source and build the binaries\n\n```cmd\nsudo yum update -y\nsudo yum install gcc gcc-java libgcj libgcj-devel gcc-c++ wget unzip\ncurl -SsLO https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/pdftk-2.02-src.zip\nunzip pdftk-2.02-src.zip\ncd pdftk-2.02-dist/pdftk\nmake -f Makefile.Redhat\nsudo make -f Makefile.Redhat install\n```\n\nThis process outputs two files:\n\n1. The main binary file is located at `/usr/local/bin/pdftk`\n2. A shared library at `/usr/lib64/libgcj.so.10` that must be copied at some location defined in the environment variable **LD_LIBRARY_PATH**\n\nAccording to [AWS Documentation](https://docs.aws.amazon.com/lambda/latest/dg/current-supported-versions.html), there are two paths exported as environment variables directly related to AWS Lambda Layers (as they unzip under `/opt`)\n\n* **LD_LIBRARY_PATH** includes `/opt/lib`\n* **PATH** includes `/opt/bin`\n\nThe ZIP file resulting from executing `make` in this package will store both binary files under the corresponding directories, so it is ready to use system wide.\n\n### Usage\n\nThe Layer is independent from the Lambda Function Runtime, so it should be available for any of them.\n","funding_links":[],"categories":["Makefile"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finetsys%2Fpdftk-aws-lambda","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finetsys%2Fpdftk-aws-lambda","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finetsys%2Fpdftk-aws-lambda/lists"}