<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Arial,Helvetica,sans-serif;" dir="ltr">
<p>><span style="font-size: 12pt;">Can I copy libopenjpeg.so.2 and tell pdftoppm where it lives?</span></p>
<div><br>
</div>
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 <span>-Wl,--rpath -Wl,/usr/local/lib (for example) to build a default path into the pdftoppm
executable.</span>
<div><br>
</div>
<div>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.</div>
<div><br>
</div>
<div>Regards, William<br>
<br>
<div style="color: rgb(0, 0, 0);">
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> poppler <poppler-bounces@lists.freedesktop.org> on behalf of Chris Kovey <chrisancode@outlook.com><br>
<b>Sent:</b> Saturday, April 22, 2017 2:15 PM<br>
<b>To:</b> poppler@lists.freedesktop.org<br>
<b>Subject:</b> [poppler] Help with poppler on AWS Lambda</font>
<div> </div>
</div>
<div>
<div id="divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; font-family:Calibri,Arial,Helvetica,sans-serif">
<p></p>
<div>
<div>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</div>
<div><br>
</div>
<div>However there are some limits involved: http://docs.aws.amazon.com/lambda/latest/dg/limits.html</div>
<div><br>
</div>
<div>* 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</div>
<div>* The total amount of code + binaries must be under 50mb</div>
<div>* 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</div>
<div><br>
</div>
<div>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.</div>
<div><br>
</div>
<div>Here is my configure:</div>
<div>[ec2-user@ip-10-0-2-96 poppler-bin-static]$ ./configure --enable-static --prefix /home/ec2-user/poppler-bin-static/</div>
<div><br>
</div>
<div>https://gist.github.com/chrisan/b028db22902c0768e72e05abb481208c#file-config_results</div>
<div><br>
</div>
<div>Then `make install` results in these files https://gist.github.com/chrisan/b028db22902c0768e72e05abb481208c#file-make_results</div>
<div><br>
</div>
<div>I then copy the folder that was created with make to a fresh AMI with no packages/libraries installed and attempt to run</div>
<div><br>
</div>
<div>[ec2-user@ip-10-0-2-186 ~]$ ./poppler-bin-static/bin/pdfinfo</div>
<div>./poppler-bin-static/bin/pdfinfo: error while loading shared libraries: libopenjpeg.so.2: cannot open shared object file: No such file or directory</div>
<div><br>
</div>
<div>This is where I'm stuck.</div>
<div><br>
</div>
<div>Is there a way to make the binary so it includes libopenjpeg.so.2 (and whatever else)? </div>
<div><br>
</div>
<div>Can I copy libopenjpeg.so.2 and tell pdftoppm where it lives?</div>
<div><br>
</div>
<div>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)</div>
<div><br>
</div>
Thank you for any assistance</div>
<div>-Chris</div>
<p></p>
</div>
</div>
</div>
</div>
</div>
</body>
</html>