Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PDFtk error when doing any command on Mac OS X

Tags:

pdftk

We have installed PDFTK server edition on Mac OS X 10.10 and Ubuntu 12 and Ubuntu 14.

When trying to do a dump_data_fields for any PDF it seems to throw a weird error before even getting to that operation..

$ pdftk SchoolPermissionSlip.pdf dump_data_fields
dyld: _dyld_bind_fully_image_containing_address() error
dyld: Symbol not found: ___emutls_get_address
  Referenced from: /opt/pdflabs/pdftk/bin/../lib/libgcj.11.dylib
  Expected in: /usr/lib/libSystem.B.dylib
 in /opt/pdflabs/pdftk/bin/../lib/libgcj.11.dylib
Trace/BPT trap: 5

It's the latest version. Any ideas?

pdftk --version

pdftk 2.02 a Handy Tool for Manipulating PDF Documents
Copyright (c) 2003-13 Steward and Lee, LLC - Please Visit: www.pdftk.com
This is free software; see the source code for copying conditions. There is
NO warranty, not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
like image 778
bjm88 Avatar asked Nov 23 '25 05:11

bjm88


1 Answers

We have seen reports of this error intermittently on Mac OS X only.

That ___emutls_get_address symbol is provided by pdftk's own libgcc_s.1.dylib. The default location for pdftk's libraries on OS X is /opt/pdflabs/pdftk/lib. The default location for the pdftk binary is /opt/pdflabs/pdftk/bin/pdftk. If you ever move this pdftk binary, it is important to move its libraries along with it so that the pdftk bin directory remains siblings with this lib directory. This helps ensure that the binary can find its libraries. Perhaps your pdftk binary has been moved without also moving these libraries?

In any case, we have a solution that has worked for others.

Reading the dyld man page, the DYLD_LIBRARY_PATH environment variable can be used to give precedence to pdftk's libraries. From the Terminal, run:

export DYLD_LIBRARY_PATH=/opt/pdflabs/pdftk/lib:$DYLD_LIBRARY_PATH

Then test pdftk:

pdftk input.pdf dump_data_fields output data.txt
like image 161
Sid Steward Avatar answered Nov 24 '25 22:11

Sid Steward



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!