junrrein / pdfslicer Goto Github PK
View Code? Open in Web Editor NEWA simple application to extract, merge, rotate and reorder pages of PDF documents
Home Page: https://junrrein.github.io/pdfslicer/
License: GNU General Public License v3.0
A simple application to extract, merge, rotate and reorder pages of PDF documents
Home Page: https://junrrein.github.io/pdfslicer/
License: GNU General Public License v3.0
Right now, the space that is reserved for thumbnails is less than the space they actually occupy. This produces a jarring effect when they are shown and looks unpleasant.
We should fix the way we calculate how much space to reserve for a thumbnail.
Some pdfs don't start with page one – they have a custom page number (also called page label). At the moment under every pdf page pdfslicer
shows the page number. By double-clicking on it we could change it, if this would be implemented.
Since 6925e5a
Compilation output excerpt:
[2/42] Building CXX object src/backend/CMakeFiles/backend.dir/document.cpp.obj
FAILED: src/backend/CMakeFiles/backend.dir/document.cpp.obj
/usr/bin/x86_64-w64-mingw32-g++ -I/home/julian/Programacion/qtcreator-projects/pdfslicer/src/backend -isystem /home/julian/Programacion/qtcreator-projects/pdfslicer/third-party/PDF-Writer/PDFWriter -I/home/julian/Programacion/qtcreator-projects/pdfslicer/src/config -isystem /usr/x86_64-w64-mingw32/sys-root/mingw/include/gtkmm-3.0 -isystem /usr/x86_64-w64-mingw32/sys-root/mingw/lib/gtkmm-3.0/include -isystem /usr/x86_64-w64-mingw32/sys-root/mingw/include/atkmm-1.6 -isystem /usr/x86_64-w64-mingw32/sys-root/mingw/include/gdkmm-3.0 -isystem /usr/x86_64-w64-mingw32/sys-root/mingw/lib/gdkmm-3.0/include -isystem /usr/x86_64-w64-mingw32/sys-root/mingw/include/giomm-2.4 -isystem /usr/x86_64-w64-mingw32/sys-root/mingw/lib/giomm-2.4/include -isystem /usr/x86_64-w64-mingw32/sys-root/mingw/include/pangomm-1.4 -isystem /usr/x86_64-w64-mingw32/sys-root/mingw/lib/pangomm-1.4/include -isystem /usr/x86_64-w64-mingw32/sys-root/mingw/include/glibmm-2.4 -isystem /usr/x86_64-w64-mingw32/sys-root/mingw/lib/glibmm-2.4/include -isystem /usr/x86_64-w64-mingw32/sys-root/mingw/include/gtk-3.0 -isystem /usr/x86_64-w64-mingw32/sys-root/mingw/include/cairo -isystem /usr/x86_64-w64-mingw32/sys-root/mingw/include -isystem /usr/x86_64-w64-mingw32/sys-root/mingw/include/pango-1.0 -isystem /usr/x86_64-w64-mingw32/sys-root/mingw/include/harfbuzz -isystem /usr/x86_64-w64-mingw32/sys-root/mingw/include/atk-1.0 -isystem /usr/x86_64-w64-mingw32/sys-root/mingw/include/cairomm-1.0 -isystem /usr/x86_64-w64-mingw32/sys-root/mingw/lib/cairomm-1.0/include -isystem /usr/x86_64-w64-mingw32/sys-root/mingw/include/pixman-1 -isystem /usr/x86_64-w64-mingw32/sys-root/mingw/include/freetype2 -isystem /usr/x86_64-w64-mingw32/sys-root/mingw/include/libpng16 -isystem /usr/x86_64-w64-mingw32/sys-root/mingw/include/sigc++-2.0 -isystem /usr/x86_64-w64-mingw32/sys-root/mingw/lib/sigc++-2.0/include -isystem /usr/x86_64-w64-mingw32/sys-root/mingw/include/gdk-pixbuf-2.0 -isystem /usr/x86_64-w64-mingw32/sys-root/mingw/include/glib-2.0 -isystem /usr/x86_64-w64-mingw32/sys-root/mingw/lib/glib-2.0/include -I/home/julian/Programacion/qtcreator-projects/pdfslicer/third-party/stduuid -I/home/julian/Programacion/qtcreator-projects/pdfslicer/third-party/GSL -I/home/julian/Programacion/qtcreator-projects/pdfslicer/third-party/GSL/include -isystem /usr/x86_64-w64-mingw32/sys-root/mingw/include/poppler/glib -isystem /usr/x86_64-w64-mingw32/sys-root/mingw/include/poppler -g -Wall -Wextra -Wpedantic -Wshadow -Wduplicated-cond -Wduplicated-branches -Wlogical-op -mms-bitfields -std=gnu++1z -MD -MT src/backend/CMakeFiles/backend.dir/document.cpp.obj -MF src/backend/CMakeFiles/backend.dir/document.cpp.obj.d -o src/backend/CMakeFiles/backend.dir/document.cpp.obj -c /home/julian/Programacion/qtcreator-projects/pdfslicer/src/backend/document.cpp
In file included from /usr/x86_64-w64-mingw32/sys-root/mingw/include/c++/ext/string_conversions.h:41:0,
from /usr/x86_64-w64-mingw32/sys-root/mingw/include/c++/bits/basic_string.h:6349,
from /usr/x86_64-w64-mingw32/sys-root/mingw/include/c++/string:52,
from /usr/x86_64-w64-mingw32/sys-root/mingw/include/c++/stdexcept:39,
from /usr/x86_64-w64-mingw32/sys-root/mingw/include/c++/array:39,
from /usr/x86_64-w64-mingw32/sys-root/mingw/include/c++/tuple:39,
from /usr/x86_64-w64-mingw32/sys-root/mingw/include/c++/functional:54,
from /usr/x86_64-w64-mingw32/sys-root/mingw/include/sigc++-2.0/sigc++/reference_wrapper.h:22,
from /usr/x86_64-w64-mingw32/sys-root/mingw/include/sigc++-2.0/sigc++/adaptors/bound_argument.h:24,
from /usr/x86_64-w64-mingw32/sys-root/mingw/include/sigc++-2.0/sigc++/adaptors/bind.h:6,
from /usr/x86_64-w64-mingw32/sys-root/mingw/include/sigc++-2.0/sigc++/adaptors/adaptors.h:23,
from /usr/x86_64-w64-mingw32/sys-root/mingw/include/sigc++-2.0/sigc++/sigc++.h:107,
from /usr/x86_64-w64-mingw32/sys-root/mingw/include/glibmm-2.4/glibmm/signalproxy.h:27,
from /usr/x86_64-w64-mingw32/sys-root/mingw/include/glibmm-2.4/glibmm/objectbase.h:22,
from /usr/x86_64-w64-mingw32/sys-root/mingw/include/glibmm-2.4/glibmm/object.h:29,
from /home/julian/Programacion/qtcreator-projects/pdfslicer/src/backend/page.hpp:20,
from /home/julian/Programacion/qtcreator-projects/pdfslicer/src/backend/command.hpp:20,
from /home/julian/Programacion/qtcreator-projects/pdfslicer/src/backend/commandmanager.hpp:20,
from /home/julian/Programacion/qtcreator-projects/pdfslicer/src/backend/document.hpp:20,
from /home/julian/Programacion/qtcreator-projects/pdfslicer/src/backend/document.cpp:17:
/usr/x86_64-w64-mingw32/sys-root/mingw/include/c++/cstdlib:75:15: fatal error: stdlib.h: No such file or directory
#include_next <stdlib.h>
^~~~~~~~~~
compilation terminated.
It seems that Fedora's MinGW-Cmake thingie adds -isystem to the Gtkmm includes when they are added with target_link_libraries
, when it shouldn't do so.
We could work around the issue by specially handling the including and linkg of Gtkmm and Poppler.
We should probably report this to upstream.
Zooming with:
However, it does not work with just scrolling while holding Ctrl.
In Nautilus, this e.g. works.
When you open a document with a lot of pages (> 700) and scroll, you may have to wait some time for the PDF thumbnails to be generated.
During that time, however, you cannot select any items.
Actually you should be able to select the files already, as (use case:) there is a good chance you already have the file open in your PDF viewer and already know the pages you want to extract/manipulate.
When I hit save, it always defaults to the home directory, and it doesn't even remember last selected directory during the session. It would be very convenient if the save dialog could show the same location as the source PDF was selected from, by default.
Currently I am testing Slicer in a VM, and shift-selection doesn't seem to work.
This should be tested on a normal Windows installation, to check if this issue isn't just a VirtualBox quirkiness.
It would be cool to be able to re-order pages via drag and drop, as it'd be faster and more direct than selecting pages and then clicking the move buttons. PDF Mod did this and it was really useful.
I quite often need to remove specific pages from a PDF document, e.g. pages 37 and 85 should be removed. This is not easily possible with PdfSlicer, because it doesn't show page numbers (as opposed to e.g. PdfShuffler). So in order to remove the right pages, I have to know what they look like (which might be tricky, if many of them look similar from the thumbnail) and just wildly guess their relative position in the app window.
Please show page numbers alongside the thumbnail, thank you.
Hi, this tool is great, but it would be greater if we can the posibility to join several pdf files into one, as a new feature.
Hi!
Try this:
Open any PDF in Slicer > Select ALL pages > click on the hamburger-menu on the bottom bar.
"Remove unselected pages" should not be clickable, because there are no unselected pages.
If that "Remove unselected pages" is clicked, the application crashes.
:)
It will probably be made using Github Pages and live on github.io.
The Adwaita Dark Theme is not recognised by PDFSlicer. Principally, it is possible to execute it manually with GTK_THEME=Adwaita:dark as environment variable to get it displayed in the dark design. But it's rather strange that the application doesn't adapt automatically, I never had this problem with other flatpak applications before. I'm running it on Arch Linux.
Those shortcuts being for the zoom-in and zoom-out actions.
The last window state should be restored when opening Slicer again.
This was filed as a bug report on the Flathub repo for Slicer [1].
From that bug report:
VosaXalo commented 25 days ago
I have found out that the zoom functionality often freezes the PDFSlicer interface and I have to kill the process.
I'm using the app on KDE neon 18.04.
PDF Slicer is currently functional, but I don't like the design very much. The functionality is spread all around the window and I think it would be better if undo/redo actions were placed alongside the actions for removing pages.
A redesign should be made before adding any new functionality (like merging multiple documents into a single one).
When there is an open document and another one is opened, the memory consumed by the previous document doesn't appear to be freed (as reported by gnome-system-monitor and htop).
But according to Heaptrack, that memory is indeed freed correctly.
Maybe the leak is happening at a lower level (Glib, Gtk) because of a misuse of those libraries?
There is a typo on the Website, seemingly coming from: https://github.com/junrrein/pdfslicer/blob/gh-pages/_config.yml#L2 : PFD -> PDF.
(Also I just discovered this tool -- thank you! It looks really good and it is fast as far as I can tell.)
For example I have a PDF of 50 pages. I have other PDF composed from 1 page or 3 pages & I like to insert it within 1st PDF that was composed of 50 pages originally.
You should allow user to specify where like to insert 2nd PDF:
Hi!
I noticed that Splicer uses the same icon for two different menus: the hambuger-menu on the topleft of the headerbar and the hamburger-menu on the bottom bar.
I haven't found suggestion about this in the HIGs. Still, I'd like to suggest to avoid using the same icon twice (or more) on the same window, it makes the two buttons a bit misleading imho.
I would like to suggest a different approach for the couple of buttons trash+hamburger on the bottom bar, similar to that used in nautilus headerbar:
[ 🗑 | ⯆ ]
What do you think? :)
Would be great to have a way to crop page margins as well!
pdfslicer/src/backend/documentsaver.cpp
Line 10 in 9c06387
Taking into account the application works with just PDFs, I think it is a good idea to change the name to PdfSaver. (PDF = Portable Document Format)
I also suggest rename methods
saveDocument()
and writePdfFile()
to
save()
and persist()
(or writeToDisk()
, but it think it is better just persist()
) respectively
Can you kindly add ability to add new (blank) page(s) to PDF ? This is wanted feature & we miss it on Linux.
Do you plan to add a possibility to extract single pages from a double-page layout, as shown here?
Can you kindly add this ability ?
The whole UML PDF is around 20MB of size. When you convert it and split only a small part (~15 pages) out of it, the resulting file is possibly even bigger than the original file!
I guess this is just some bad compression or so.
In any case, this should possibly not happen…
It would be ideal if we don't have to approve new languages manually. We need to investigate if Weblate is able to automatically generate a new .po file from a .pot file at a translator's request.
pdfslicer/src/application/application.cpp
Line 74 in 8c74b34
AppWindow should be responsible only of displaying data. You could have an DocumentOpener that knows only how to open a document. This implies having an interface that could be tested.
DocumentOpener::open(File aDocumentFile)
In the same way, there could be a DocumentSaver with a save(aDocument)
When selecting f.i. the first three pages of this pdf and then removing the others, then your app crashes when saving it.
Happens with the latest version from Flathub (1.5.3) on Ubuntu 18.10.
Please look to this program that it's developer stop from completing it's development:
http://jpdftweak.sourceforge.net/
https://sourceforge.net/projects/jpdftweak/
It is very powerful tool but need to adding few features to make it a good replacement for many Adobe acrobat pro for Linuxers. In fact with Okular can do this. However, as I said, his developer stop from it's development. I contact him about this.
It contain most of features of PDF manipulation ! Just few push forward & will be excellent ! Unfortunately I'm not programmer ..... Any one continue it's development will make soo good for peoples ......
Please see it. May be useful for your application or you can take over to complete it's development under new name. It is open source application.
Hi. There is a very very powerful command line program called QPDF. Unfortunately it has no GUI.
It will elevate your application up if you utilize it as a backend in addition to poppler.
See it at:
https://github.com/qpdf/qpdf
It's developer very active & very co-operative. However, he is not interested in creation of a frontend to it's application. Inspite this fact he is very ready to help any one like to create a GUI for his program.
Can you kindly add ability to delete page(s) from original PDF ?
User should be able to specify page(s) she/he like to delete.
User should be able to specify a range of pages like to delete if she/he intend for that.
It will be nice & useful to add this ability.
Both poppler & QPDF support this functionality.
Ideally, the license would be GPLv3.
The only issue is that CTPL, which is licensed under the Apache license, can't be used as a shared library, because it's a templated library. I've not yet researched the interactions between Apache and GPL projects.
This happens because we don't store the document in memory. When overwriting, we can no longer restore deleted pages.
To solve this, we should look into storing a copy of the opened file in memory or as a temporary file.
Hello,
can you please allow opening documents by dragging and dropping the file onto the application window?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.