Paperwork 2.0.2

Hello,

I’ve released Paperwork 2.0.2. This is mostly a bug-fixes-only version.

Main changes are:

  • GTK: pageview.boxes: add workaround regarding unexpected Poppler exceptions on some PDF documents (see https://gitlab.freedesktop.org/poppler/poppler/-/issues/1020 )
  • beacon.sysinfo: report some extra infos to openpaper.work: CPU max frequency, number of CPU cores, amount of memory, version of Python.
  • GTK: add a command “paperwork-gtk import”: Open the GUI and import the documents given as arguments (thanks to Guillaume Girol)
  • GTK: .desktop file: associate “paperwork-gtk install” to PDF and images files, so users can import files directly from their file browser (thanks to Guillaume Girol)
  • Backend: add dependency on psutil
  • Commands “config”: When parsing boolean value, accepts “false” and “0” as input for False
  • shell: add command ‘chkworkdir’: Check work directory integrity and fix it
  • shell: doc import: Fix: Load the labels before importing documents
  • Backend: PDF: Fix: Write page mapping in the order of original page indexes, as expected when we read it back later (otherwise, we may get weird behaviours)
  • GTK: add plugin ‘sync_on_start’: Start the full synchronization when the GUI is started, but only if the configuration allows it. (Before this plugin, synchronization was started directly in the ‘main.py’)
  • GTK: drawer.scan: Workaround regarding scanners reporting an image too big for Cairo ImageSurface (some Fujitsu scanners)
  • GTK: settings/storage: when opening the file chooser to select the work directory, pre-select the current work directory
  • GTK: boxes.search: do not highlight the keywords “and” and “or”. They are used in Whoosh query syntax, but it’s useless to highlight them in documents.

Detailed ChangeLog can be found here:

Best regards,

1 Like

updated successfully and everything seems to be OK.

Thanks!

flatpak, V2.02
I’m having trouble with Paperwork finding the scanner, a Fujitsu snapscan S1500.
xsane finds it, sane-find-scanner doesn’t find it as user, does as root.
I think saned.socket, /etc/sane.d/saned.conf and users are correct.
Suggestions?

Thanks,
Kent

@ktenney Yes, it’s probably a permission issue preventing Saned from accessing the scanner.

Try ls -l /dev/bus/usb/*/* in a terminal. One of the device file probably belongs to a specific user group (in other words, not root).

@ktenney By the way, I assume you have done that first: https://gitlab.gnome.org/World/OpenPaperwork/paperwork/-/blob/master/doc/install.flatpak.markdown#allowing-paperwork-to-access-scanners , right ?

ktenney@pavilion:~$ groups saned
saned : saned lp plugdev scanner

ktenney@pavilion:~$ sudo systemctl status saned.socket
● saned.socket - saned incoming socket
Loaded: loaded (/lib/systemd/system/saned.socket; enabled; vendor preset: enabled)
Active: active (listening) since Fri 2021-01-01 15:22:19 CST; 28min ago
Triggers: ● saned@0-127.0.0.1:6566-127.0.0.1:36268.service
Listen: [::]:6566 (Stream)
Accepted: 1; Connected: 1;
Tasks: 0 (limit: 8857)
Memory: 72.0K
CGroup: /system.slice/saned.socket

ktenney@pavilion:~$ ls -l /dev/bus/usb//
crw-rw-r-- 1 root root 189, 0 Jan 1 15:22 /dev/bus/usb/001/001
crw-rw-r-- 1 root root 189, 1 Jan 1 15:22 /dev/bus/usb/001/002
crw-rw-r–+ 1 root root 189, 3 Jan 1 15:22 /dev/bus/usb/001/004
crw-rw-r–+ 1 root lp 189, 4 Jan 1 15:30 /dev/bus/usb/001/005
crw-rw-r-- 1 root root 189, 128 Jan 1 15:22 /dev/bus/usb/002/001
crw-rw-r-- 1 root root 189, 129 Jan 1 15:22 /dev/bus/usb/002/002
crw-rw-r-- 1 root root 189, 256 Jan 1 15:22 /dev/bus/usb/003/001
crw-rw-r-- 1 root root 189, 257 Jan 1 15:22 /dev/bus/usb/003/002
crw-rw-r-- 1 root root 189, 384 Jan 1 15:22 /dev/bus/usb/004/001
crw-rw---- 1 root plugdev 189, 385 Jan 1 15:22 /dev/bus/usb/004/002
crw-rw-r-- 1 root root 189, 512 Jan 1 15:22 /dev/bus/usb/005/001
crw-rw-r-- 1 root root 189, 640 Jan 1 15:22 /dev/bus/usb/006/001
crw-rw-r-- 1 root root 189, 768 Jan 1 15:22 /dev/bus/usb/007/001
crw-rw-r-- 1 root root 189, 896 Jan 1 15:22 /dev/bus/usb/008/001

ktenney@pavilion:~$ lsusb
Bus 002 Device 002: ID 5986:02ac Acer, Inc HP TrueVision HD
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 002: ID 138a:0018 Validity Sensors, Inc. Fingerprint scanner
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 005: ID 04a9:1794 Canon, Inc.
Bus 001 Device 004: ID 04c5:11a2 Fujitsu, Ltd USB 2.0 Hub
Bus 001 Device 002: ID 1a40:0101 Terminus Technology Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 002: ID 046d:c52b Logitech, Inc. Unifying Receiver
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 008 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 007 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 006 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 005 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

I’m trying out paperwork for the first time and since there’s a new release I thought I’d test that.My Mint distro privides a version, 1.3.1. Even though it’s outdated it is interesting. Is there a repo where I can install the newer version and check it out?

@ktenney I assume you have also added the line 127.0.0.1 to /etc/sane.d/saned.conf, right ?

@midol

The Flatpak version is the easiest option for that: https://gitlab.gnome.org/World/OpenPaperwork/paperwork/-/blob/master/doc/install.flatpak.markdown

ktenney@pavilion:~$ tail /etc/sane.d/saned.conf
#192.168.0.1
#192.168.0.1/29
#[2001:db8:185e::42:12]
#[2001:db8:185e::42:12]/64
127.0.0.1

yes that seems to have worked ok and I see improvements. Thanks very much, I’ll test and report back.

d

@ktenney

Hm, okay, can you try the following command then:

flatpak run --command="scanimage" work.openpaper.Paperwork -L

If it finds your scanners, the problem is on Paperwork side, if not, it is on Saned side.

scanimage -L fails in the flatpak, succeeds outside
does that suggest a remedy?

ktenney@pavilion:~$ flatpak run --command=“scanimage” work.openpaper.Paperwork -L

No scanners were identified. If you were expecting something different,
check that the scanner is plugged in, turned on and detected by the
sane-find-scanner tool (if appropriate). Please read the documentation
which came with this software (README, FAQ, manpages).

ktenney@pavilion:~$ scanimage -L
device `fujitsu:ScanSnap S1500:378078’ is a FUJITSU ScanSnap S1500 scanner

That suggests that the problem is between libsane (in the Flatpak container) and Saned (on your host system).

Do you have a firewall running that may block traffic on the loopback ?

You can try using tcpdump (sudo tcpdump -ni lo port 6566) to see if there is some traffic going between the libsane and Saned when you start Paperwork (Paperwork looks for scanners when it starts).

Here’s the output when doing ‘flatpak run work.openpaper.Paperwork’

ktenney@pavilion:~$ sudo tcpdump -ni lo port 6566
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on lo, link-type EN10MB (Ethernet), capture size 262144 bytes
16:10:39.349864 IP 127.0.0.1.41058 > 127.0.0.1.6566: Flags [S], seq 3393929403, win 65495, options [mss 65495,sackOK,TS val 1190293992 ecr 0,nop,wscale 7], length 0
16:10:39.349899 IP 127.0.0.1.6566 > 127.0.0.1.41058: Flags [S.], seq 2159103057, ack 3393929404, win 65483, options [mss 65495,sackOK,TS val 1190293992 ecr 1190293992,nop,wscale 7], length 0
16:10:39.349930 IP 127.0.0.1.41058 > 127.0.0.1.6566: Flags [.], ack 1, win 512, options [nop,nop,TS val 1190293992 ecr 1190293992], length 0
16:10:39.352355 IP 127.0.0.1.41058 > 127.0.0.1.6566: Flags [P.], seq 1:21, ack 1, win 512, options [nop,nop,TS val 1190293995 ecr 1190293992], length 20
16:10:39.352378 IP 127.0.0.1.6566 > 127.0.0.1.41058: Flags [.], ack 21, win 512, options [nop,nop,TS val 1190293995 ecr 1190293995], length 0
16:10:39.366866 IP 127.0.0.1.6566 > 127.0.0.1.41058: Flags [P.], seq 1:9, ack 21, win 512, options [nop,nop,TS val 1190294009 ecr 1190293995], length 8
16:10:39.366904 IP 127.0.0.1.41058 > 127.0.0.1.6566: Flags [.], ack 9, win 512, options [nop,nop,TS val 1190294009 ecr 1190294009], length 0
16:10:39.367006 IP 127.0.0.1.41058 > 127.0.0.1.6566: Flags [P.], seq 21:25, ack 9, win 512, options [nop,nop,TS val 1190294009 ecr 1190294009], length 4
16:10:39.367048 IP 127.0.0.1.6566 > 127.0.0.1.41058: Flags [.], ack 25, win 512, options [nop,nop,TS val 1190294009 ecr 1190294009], length 0
16:10:44.730535 IP 127.0.0.1.6566 > 127.0.0.1.41058: Flags [P.], seq 9:21, ack 25, win 512, options [nop,nop,TS val 1190299373 ecr 1190294009], length 12
16:10:44.730573 IP 127.0.0.1.41058 > 127.0.0.1.6566: Flags [.], ack 21, win 512, options [nop,nop,TS val 1190299373 ecr 1190299373], length 0
16:10:45.071138 IP 127.0.0.1.41058 > 127.0.0.1.6566: Flags [P.], seq 25:29, ack 21, win 512, options [nop,nop,TS val 1190299713 ecr 1190299373], length 4
16:10:45.071183 IP 127.0.0.1.6566 > 127.0.0.1.41058: Flags [.], ack 29, win 512, options [nop,nop,TS val 1190299713 ecr 1190299713], length 0
16:10:49.828913 IP 127.0.0.1.6566 > 127.0.0.1.41058: Flags [P.], seq 21:33, ack 29, win 512, options [nop,nop,TS val 1190304471 ecr 1190299713], length 12
16:10:49.828943 IP 127.0.0.1.41058 > 127.0.0.1.6566: Flags [.], ack 33, win 512, options [nop,nop,TS val 1190304471 ecr 1190304471], length 0
16:10:55.817562 IP 127.0.0.1.41058 > 127.0.0.1.6566: Flags [F.], seq 29, ack 33, win 512, options [nop,nop,TS val 1190310460 ecr 1190304471], length 0
16:10:55.823723 IP 127.0.0.1.6566 > 127.0.0.1.41058: Flags [F.], seq 33, ack 30, win 512, options [nop,nop,TS val 1190310466 ecr 1190310460], length 0
16:10:55.823764 IP 127.0.0.1.41058 > 127.0.0.1.6566: Flags [.], ack 34, win 512, options [nop,nop,TS val 1190310466 ecr 1190310466], length 0

Weird, the connection appears to be established correctly.

@ktenney : what Linux distribution do you use ? (I’m going to check the Sane package versions)

Ubuntu 20.04.1

tenney@pavilion:~$ aptitude show sane
Package: sane
Version: 1.0.14-15
State: installed
Automatically installed: no
Priority: optional
Section: universe/graphics
Maintainer: Ubuntu Developers ubuntu-devel-discuss@lists.ubuntu.com
Architecture: amd64
Uncompressed Size: 309 k
Depends: libc6 (>= 2.14), libgimp2.0 (>= 2.4.0), libglib2.0-0 (>= 2.12.0), libgtk2.0-0 (>= 2.24.0), libsane (>= 1.0.24)
Suggests: gimp
Description: scanner graphical frontends
This package includes :
o xscanimage, a scanner graphical frontend with GIMP 2.0 support
o scanadf, a command-line frontend for scanners with Automatic Document Feeder
o xcam, for acquiring images continuously from cameras.

An alternative to xscanimage called xsane is packaged separately.

The scanner frontends use SANE. SANE stands for “Scanner Access Now Easy” and is an application programming interface (API) that provides
standardized access to any raster image scanner hardware (flatbed scanner, hand-held scanner, video- and still-cameras, frame-grabbers, etc.). The
SANE standard is free and its discussion and development are open to everybody. The current source code is written to support several operating
systems, including GNU/Linux, OS/2, Win32 and various Unices and is available under the GNU General Public License (commercial applications and
backends are welcome, too, however).
Homepage: http://www.sane-project.org

FYI I tried on another computer, same result.
I also tried with a flatbed scanner connected, Paperwork didn’t find it.

I’ve pushed a new version of the Flatpak build recipe that includes the latest version of sane-backends/sane-utils (1.0.29). I’ve only pushed it for the branch develop at the moment (I don’t want to risk breaking master).

At the moment, the build is still running: https://gitlab.gnome.org/World/OpenPaperwork/paperwork/-/pipelines/243919 .

Once the build will be ready, you can switch to the branch develop with:

flatpak uninstall --user work.openpaper.Paperwork
flatpak --user install https://builder.openpaper.work/paperwork_develop.flatpakref

To switch back to the branch master:

flatpak uninstall --user work.openpaper.Paperwork
flatpak --user install https://builder.openpaper.work/paperwork_master.flatpakref