[poppler] Help with poppler on AWS Lambda
William Bader
williambader at hotmail.com
Sun Apr 23 16:17:12 UTC 2017
>Can I copy libopenjpeg.so.2 and tell pdftoppm where it lives?
I think that you can set the LD_LIBRARY_PATH environment variable before running pdftoppm, or if you know where the library will be, I think that you can compile with -Wl,--rpath -Wl,/usr/local/lib (for example) to build a default path into the pdftoppm executable.
You could also use 'ldd pdftoppm' to find all of the libraries it uses, and if libopenjpeg or other libraries are not present on the destination server, you can download the source and build static versions of those libraries.
Regards, William
________________________________
From: poppler <poppler-bounces at lists.freedesktop.org> on behalf of Chris Kovey <chrisancode at outlook.com>
Sent: Saturday, April 22, 2017 2:15 PM
To: poppler at lists.freedesktop.org
Subject: [poppler] Help with poppler on AWS Lambda
Hello, I would like to use poppler on AWS' Lambda service. Specifically this work flow: https://d0.awsstatic.com/Test%20Images/MasonTests/Lambda/Lambda_FileProcessing.png only instead of image processing it is PDF processing
However there are some limits involved: http://docs.aws.amazon.com/lambda/latest/dg/limits.html
* It only uses amzn-ami-hvm-2016.03.3.x86_64-gp2 (ami-6869aa05) to run the instance. I cannot create an AMI of my own with poppler installed
* The total amount of code + binaries must be under 50mb
* You can also download files from s3 if your code/binaries are larger than 50mb, but you are limited to a total of 512mb of disc space
I am trying to create a binary that is self contained with everything poppler (or specifically pdftoppm) needs to run but I am rather new to what all is involved.
Here is my configure:
[ec2-user at ip-10-0-2-96 poppler-bin-static]$ ./configure --enable-static --prefix /home/ec2-user/poppler-bin-static/
https://gist.github.com/chrisan/b028db22902c0768e72e05abb481208c#file-config_results
Then `make install` results in these files https://gist.github.com/chrisan/b028db22902c0768e72e05abb481208c#file-make_results
I then copy the folder that was created with make to a fresh AMI with no packages/libraries installed and attempt to run
[ec2-user at ip-10-0-2-186 ~]$ ./poppler-bin-static/bin/pdfinfo
./poppler-bin-static/bin/pdfinfo: error while loading shared libraries: libopenjpeg.so.2: cannot open shared object file: No such file or directory
This is where I'm stuck.
Is there a way to make the binary so it includes libopenjpeg.so.2 (and whatever else)?
Can I copy libopenjpeg.so.2 and tell pdftoppm where it lives?
If not, how would one create an executable pdftoppm that is self contained (or could be run by only copying files, NO install or compile)
Thank you for any assistance
-Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/poppler/attachments/20170423/2d3f9c0c/attachment.html>
More information about the poppler
mailing list