GithubHelp home page GithubHelp logo

jeylabs / aws-lambda-poppler-layer Goto Github PK

View Code? Open in Web Editor NEW
51.0 6.0 28.0 723 KB

AWS Lambda Poppler Layer

Dockerfile 94.58% Makefile 3.19% Shell 2.22%
aws aws-lambda poppler aws-lambda-poppler

aws-lambda-poppler-layer's Introduction

Build Poppler for Amazon Lambda as a layer

Poppler binaries for AWS Lambda

Release

Getting Started

Download poppler.zip file from releases and create / update your custom layer in AWS. You can add this layer to any Lambda function you want โ€“ no matter what runtime.

Fonts

Stix fonts added as fallback fonts. you can place your custom fonts in /tmp/fonts directory in runtime.

Install

Clone this repository and run make distribution

See Also

aws-lambda-poppler-layer's People

Contributors

oddmouse avatar pavinthan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

aws-lambda-poppler-layer's Issues

This is amazing, thank you.

Used the poppler.zip from the release and had no issues in my lambda. Thank you for your kind open-sourcing. This would have taken me forever.

poppler-21.07.0 version

Hi. I'm using aws-lambda-poppler-layer release 2.0 just fine. But I am not getting the latest version of poppler.

I ran 'make' with poppler 21.07.0, but it failed.

-- Package Qt5Core or Qt5Gui or Qt5Xml or Qt5Widgets or Qt5Test not found
-- Package Qt6Core or Qt6Gui or Qt6Widgets or Qt6Test not found

If possible, can you make the latest version of the layer? Please.

Can't find pdfinfo

I'm getting the following error:

/bin/sh: /opt/bin/pdfinfo: No such file or directory

I've created a custom layer through the AWS console. I'm using the Serverless framework to deploy my Lambda functions but I'm not having any success.

The code I'm using is:

  const toRun = `/opt/bin/`
  const { exec } = require("child_process");
  const cmd =  `${toRun}pdfinfo -v`

I would be grateful for any help you can give me.

Screenshot 2021-05-20 at 15 16 42

Use Cairo 1.16

Hi,

First of all let me join #2 in saying thank you for this!

Secondly, there is a known bug in Cairo library: https://gitlab.freedesktop.org/cairo/cairo/-/issues/358, which for some PDFs can result in free(): invalid pointer error.

It's present in version 1.17.2 but not in 1.16. There's no later version than 1.17.2 at the moment (although the commit that enabled the bug has been since reverted), so I suggest using 1.16. It's also what's used on alpine linux package:

$ docker run --rm -i -t alpine:edge sh
/ # apk add poppler-utils
fetch https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz
(1/24) Installing libxau (1.0.9-r0)
(2/24) Installing libbsd (0.10.0-r0)
(3/24) Installing libxdmcp (1.1.3-r0)
(4/24) Installing libxcb (1.14-r1)
(5/24) Installing libx11 (1.6.12-r0)
(6/24) Installing libxext (1.3.4-r0)
(7/24) Installing libxrender (0.9.10-r3)
(8/24) Installing expat (2.2.10-r0)
(9/24) Installing brotli-libs (1.0.9-r2)
(10/24) Installing libbz2 (1.0.8-r1)
(11/24) Installing libpng (1.6.37-r1)
(12/24) Installing freetype (2.10.4-r0)
(13/24) Installing libuuid (2.36-r2)
(14/24) Installing fontconfig (2.13.1-r3)
(15/24) Installing pixman (0.40.0-r2)
(16/24) Installing cairo (1.16.0-r2)            <--
(17/24) Installing lcms2 (2.11-r0)
(18/24) Installing libjpeg-turbo (2.0.5-r1)
(19/24) Installing openjpeg (2.3.1-r5)
(20/24) Installing libgcc (10.2.1_pre0-r2)
(21/24) Installing libstdc++ (10.2.1_pre0-r2)
(22/24) Installing tiff (4.1.0-r0)
(23/24) Installing poppler (20.11.0-r0)
(24/24) Installing poppler-utils (20.11.0-r0)   <--

"Unable to get page count. Is poppler installed and in PATH?"

Hi, i have add the aws-lambda-poppler-layer zip file into my aws lambda lay, but i have the problem "Unable to get page count. Is poppler installed and in PATH?" my code use the arg as "poppler_path=r"/opt/bin/",", and i'm sure the poppler_path is correct. What's happen?

Force Poppler build to use custom (new) version of a library instead of default (old) one

Hi @pavinthan!

First, I want to second #2. Thank you for open-sourcing this lambda-layer!

I need to build libvips with poppler support. I'm using the lambci/lambda:build-go1.x as base image as it matches the lambda environment very closely.

The lambda environment includes old versions of libraries such as libpng (which are not included in the amazonlinux:2018.03 image).
Still, I'm building the newest version of those libraries from source as the older ones have known security problems (see libvips/libvips#1749 (comment)).

However, Poppler picks up the pre-installed (old) versions /usr/lib64/ instead of the new version from /opt/lib during the build, e.g. it uses /usr/lib64/libpng.so instead of /opt/lib/libpng.so.

-- Found Freetype: /usr/lib64/libfreetype.so (found version "2.3.11") 
-- Checking for module 'fontconfig'
--   Found fontconfig, version 2.13.1
-- Found Fontconfig: /usr/lib64/libfontconfig.so  
-- Found JPEG: /usr/lib64/libjpeg.so (found version "62") 
-- Found ZLIB: /usr/lib64/libz.so (found version "1.2.8") 
-- Found PNG: /usr/lib64/libpng.so (found version "1.2.49") 
-- Found TIFF: /usr/lib64/libtiff.so (found version "4.0.3")

I can reproduce this issue using the Dockerfile from this repository by adding libpng and libpng-devel via yum to the image.

&& yum install -y libuuid-devel openssl-devel gcc72 gcc72-c++

Original output of Poppler build:

-- Found Freetype: /opt/lib/libfreetype.so (found version "2.10.1") 
-- Checking for module 'fontconfig'
--   Found fontconfig, version 2.13.1
-- Found Fontconfig: /opt/lib/libfontconfig.so  
-- Found JPEG: /opt/lib/libjpeg.so (found version "62") 
-- Found ZLIB: /usr/lib64/libz.so (found version "1.2.8") 
-- Found PNG: /opt/lib/libpng.so (found version "1.6.37") 
-- Found TIFF: /opt/lib/libtiff.so (found version "4.1.0")

Output of Poppler build after installing libpng and libpng-devel via yum:

-- Found Freetype: /opt/lib/libfreetype.so (found version "2.10.1") 
-- Checking for module 'fontconfig'
--   Found fontconfig, version 2.13.1
-- Found Fontconfig: /opt/lib/libfontconfig.so  
-- Found JPEG: /opt/lib/libjpeg.so (found version "62") 
-- Found ZLIB: /usr/lib64/libz.so (found version "1.2.8") 
-- Found PNG: /usr/lib64/libpng.so (found version "1.2.49") // <=== Poppler uses old verion instead of new one
-- Found TIFF: /opt/lib/libtiff.so (found version "4.1.0") 

Question:
How can I "force" Poppler to build with a custom (new) version of a library instead of the default (old) one?

I appreciate any help on this

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.