cyanfish / naps2

Scan documents to PDF and more, as simply as possible.
https://www.naps2.com
Other
2.86k stars 327 forks source link

Pdfium on CentOS #464

Open UstimVV opened 1 month ago

UstimVV commented 1 month ago

Describe the bug When I try to import PDF into NAPS2 7.5.1 I ha

To Reproduce Steps to reproduce the behavior:

  1. Go to 'Import'
  2. Choose any pdf file
  3. Click on 'Open'
  4. See error: The file 'filename.pdf' could not be imported...
  5. Technical details: System.Exception: Could not load library: "libpdfium.so". Error: see on screenshot 2024-10-03_11-59

Screenshots If applicable, add screenshots to help explain your problem.

Desktop:

cyanfish commented 1 month ago

What version of CentOS?

UstimVV commented 1 month ago

kernel version 6.6.51 centos 8

sT331h0rs3 commented 1 month ago

I had such issue, when naps2 executable was incorrectly placed in /usr/bin directory instead of /usr/lib/naps2. The error occurs because libpdfium.so is lazy-loaded from path ./_linux/libpdfium.so, relative to the naps2 executable. The full path is /usr/lib/naps2/_linux/libpdfium.so by default.

UstimVV commented 1 month ago

Executable naps2 I found in /usr/bin. I made symlink /usr/lib/naps2 -> /usr/lib64/naps2/ where I found file _linux/libpdfium.so. But I have the same error.

sT331h0rs3 commented 1 month ago

Executable naps2 should be placed in /usr/lib/naps2 directory by default (could be /usr/lib64/naps2 in some distros as well). File /usr/bin/naps2 might be a symlink to /usr/lib/naps2/naps2 though.

cyanfish commented 1 month ago

The other possibility is that Centos is using too old a glibc (2.28) for the pdfium build (it's supposed to only require 2.27 but I might have missed some change). I'll check later but if you want you can see what glibc version libpdfium.so depends on. https://stackoverflow.com/questions/3436008/how-to-determine-version-of-glibc-glibcxx-binary-will-depend-on

UstimVV commented 1 month ago
  1. Executable naps2 I put to diffrents places - no success.
  2. glibc version now 2.36
cyanfish commented 1 month ago

What's the output of ldd /lib/naps2/_linux/libpdfium.so?

cyanfish commented 1 month ago

That's... odd. It works fine on my Fedora VM (which also uses the RPM). At some point I might try creating a CentOS VM and see if I can track it down but I'm not sure what the problem is.

UstimVV commented 1 month ago

Then I use version naps2-7.1.2 I can import pdf files and output is:

ldd /lib/naps2/_linux/libpdfium.so

linux-vdso.so.1 (0x00007ffe9c199000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fbe15ba5000)
libm.so.6 => /lib64/libm.so.6 (0x00007fbe15520000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007fbe15b85000)
libc.so.6 => /lib64/libc.so.6 (0x00007fbe15343000)
/lib64/ld-linux-x86-64.so.2 (0x00007fbe15bc0000)

After update to version naps2-7.5.1 output is:

ldd /lib/naps2/_linux/libpdfium.so

ldd: warning: you do not have execute permissions `/lib/naps2/_linux/libpdfium.so' linux-vdso.so.1 (0x00007ffea496a000) libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fea86bed000) libm.so.6 => /lib64/libm.so.6 (0x00007fea86b0d000) libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007fea86aed000) libc.so.6 => /lib64/libc.so.6 (0x00007fea86423000) /lib64/ld-linux-x86-64.so.2 (0x00007fea86c08000)

UstimVV commented 1 month ago

That's... odd. It works fine on my Fedora VM (which also uses the RPM). At some point I might try creating a CentOS VM and see if I can track it down but I'm not sure what the problem is.

Thank you

UstimVV commented 4 weeks ago

Import pdf files on Version 7.5.1-2 working exelent)