Bug 1933488

Summary: pdfarranger not allowing page deletes
Product: [Fedora] Fedora Reporter: Sammy <umar>
Component: pdfarrangerAssignee: David Auer <dreua>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 33CC: dreua, fschwarz, mail
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: pdfarranger-1.7.1-1.fc34 pdfarranger-1.7.1-1.fc33 pdfarranger-1.7.1-1.fc32 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-03-22 02:08:48 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Sammy 2021-02-28 15:32:18 UTC
Fedora 33 with all daily updates.
pdfarranger-1.7.0-2.fc33.noarch
python3-pikepdf-1.19.4-1.fc33.x86_64

When opening a multipage pdf document and deleting a page one cannot save the resulting document. Get the error 'only pages can be inserted" and on console:

$ pdfarranger Hmwk_2.pdf
Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/pdfarranger/pdfarranger.py", line 748, in choose_export_pdf_name
    self.save(only_selected, file_out)
  File "/usr/lib/python3.9/site-packages/pdfarranger/pdfarranger.py", line 210, in wrapper
    func(*args, **kwargs)
  File "/usr/lib/python3.9/site-packages/pdfarranger/pdfarranger.py", line 796, in save
    exporter.export(self.pdfqueue, to_export, file_out, m)
  File "/usr/lib/python3.9/site-packages/pdfarranger/exporter.py", line 78, in export
    pdf_output.pages.append(new_page)
TypeError: only pages can be inserted

Comment 1 Sammy 2021-02-28 15:38:43 UTC
Seems to be a known issue

https://github.com/pdfarranger/pdfarranger/issues/427

This pretty much takes away the most important functionality of pdfarranger.

Comment 2 David Auer 2021-03-01 13:53:18 UTC
Hello and thank you for the report!

Unfortunately I can not reproduce this issue on Fedora 32 but it seems to be a problem between qpdf/libqpdf and pikepdf. Which version of qpdf/libqpdf do you have installed? Do you have other versions of pikepdf/qpdf installed that pdfarranger might use, e.g., with "pip install pikepdf --user"?

Installed Packages (Could not reproduce)
pdfarranger.noarch                        1.7.0-2.fc32                  @updates
python3-pikepdf.x86_64                    1.19.4-1.fc32                 @updates
qpdf.x86_64                               10.1.0-1.fc32                 @updates
qpdf-devel.x86_64                         10.1.0-1.fc32                 @updates
qpdf-libs.x86_64                          10.1.0-1.fc32                 @updates

pikepdf >= 2.7 should fix this, if you have any chance to install that: https://github.com/pikepdf/pikepdf/blob/master/docs/release_notes.rst#v270

As a temporary workaround you could also use the flatpak from flathub.

Comment 3 Sammy 2021-03-01 13:58:07 UTC
Hi, I built the pike-pdf 2.7.0 on Fedora 33 (it also required an update of python3-attrs to 20.3.0) and as advertised that solved the problem. I built these from fc34 source rpms. Hopefully, the updates make into fc33 since it still has some life!

Comment 4 David Auer 2021-03-01 14:15:23 UTC
Yes, I already asked about pikepdf updates: https://bugzilla.redhat.com/show_bug.cgi?id=1933531

I am, however, still not sure how this issue could appear on your system in the first place. Did you install qpdf 10.2.0 from updates-testing?

Comment 5 Sammy 2021-03-01 16:32:26 UTC
Yes, I have qpdf-10.2.0-1.fc33.x86_64...

Comment 6 Fedora Update System 2021-03-18 11:01:42 UTC
FEDORA-2021-950ed4046c has been submitted as an update to Fedora 32. https://bodhi.fedoraproject.org/updates/FEDORA-2021-950ed4046c

Comment 7 Fedora Update System 2021-03-18 11:01:43 UTC
FEDORA-2021-0a7943da58 has been submitted as an update to Fedora 34. https://bodhi.fedoraproject.org/updates/FEDORA-2021-0a7943da58

Comment 8 Fedora Update System 2021-03-18 11:01:44 UTC
FEDORA-2021-526acdad79 has been submitted as an update to Fedora 33. https://bodhi.fedoraproject.org/updates/FEDORA-2021-526acdad79

Comment 9 David Auer 2021-03-18 11:04:41 UTC
We ended up adding a workaround upstream, could you test the update and give Karma?

Comment 10 Sammy 2021-03-18 13:02:26 UTC
I had already updated mu pikepdf to 2.8.0 on F33 by building from source rpm so it is working. I am sure it will work for other people with the old pikepk.

Comment 11 Fedora Update System 2021-03-18 21:47:41 UTC
FEDORA-2021-0a7943da58 has been pushed to the Fedora 34 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-0a7943da58`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-0a7943da58

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 12 Fedora Update System 2021-03-19 19:30:27 UTC
FEDORA-2021-950ed4046c has been pushed to the Fedora 32 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-950ed4046c`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-950ed4046c

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 13 Fedora Update System 2021-03-19 19:38:16 UTC
FEDORA-2021-526acdad79 has been pushed to the Fedora 33 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-526acdad79`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-526acdad79

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 14 Fedora Update System 2021-03-22 02:08:48 UTC
FEDORA-2021-0a7943da58 has been pushed to the Fedora 34 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 15 Fedora Update System 2021-03-27 01:10:21 UTC
FEDORA-2021-526acdad79 has been pushed to the Fedora 33 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 16 Fedora Update System 2021-03-27 01:23:24 UTC
FEDORA-2021-950ed4046c has been pushed to the Fedora 32 stable repository.
If problem still persists, please make note of it in this bug report.