Coder Social home page Coder Social logo

junrrein / pdfslicer Goto Github PK

View Code? Open in Web Editor NEW
139.0 139.0 17.0 68.71 MB

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

CMake 10.99% C++ 88.68% Python 0.26% Shell 0.07%

pdfslicer's People

Contributors

abhijeetviswa avatar albanobattistella avatar aleuqabali avatar amalvarenga avatar amivaleo avatar atalanttore avatar coderbm1 avatar comradekingu avatar debnone avatar emintufan avatar etamuk avatar floflr avatar iosifidis avatar jokeyser avatar jose1711 avatar junrrein avatar milotype avatar miltolstoy avatar naofum avatar nautilusx avatar norhorn avatar santossi avatar sc0o0p avatar shimsa avatar taotieren avatar vistaus avatar waldist avatar weblate avatar yarons avatar yvan-masson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

pdfslicer's Issues

Fix thumbnail spacing

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.

Support custom page numbering

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.

Cross-compiling to Windows is broken

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.

Zoom with Ctrl+Scroll

Zooming with:

  • buttons works
  • Ctrl++/Ctrl+- works

However, it does not work with just scrolling while holding Ctrl.

In Nautilus, this e.g. works.

Allow selecting pages when they are still loading

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.

Save into the same directory as the original document

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.

Shift-selection doesn't seem to work on Windows

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.

Re-ordering via drag & drop

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.

Show page numbers

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.

Setup a website

It will probably be made using Github Pages and live on github.io.

Use better "Move left" and "Move right" icons

Right now these icons don't look good alongside the Adwaita icon theme (and the Papirus theme).

Their only saving grace is that they work correctly on dark themes. Any replacement should take this in mind.

For reference:
sin nombre
(Those icons are all in the "enabled" state")

Adwaita Dark Theme not working

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.

UI Redesign

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).

Investigate memory consumption

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?

[Feature request] Insert PDF within other PDF file

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:

  • at beginning (before 1st page of 1st PDF), or
  • at end (after last page of 1st PDF), or
  • within 1st PDF (like after page 40 of 1st PDF)

New app icon?

Since the new GNOME app icon guidelines are in effect now, I'm reaching out to ask if you'd be interested in a new icon following those guidelines. Here's an initial concept:

image

UI change - avoid two hamburger-menus?

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? :)

Suggestion about Improving name meaningfulness

DocumentSaver::DocumentSaver(Document& document)

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

Ability to add new blank page(s)

Can you kindly add ability to add new (blank) page(s) to PDF ? This is wanted feature & we miss it on Linux.

  • You should allow user to specify number of pages that like to be added (1 or 2 or ...... ) one after other.
  • You should allow user to specify "After" or "Before" which page in original PDF like to add new blank page(s).
  • You should allow user to specify size of new blank page(s). You can give user following options for that:
  1. same size of previous page
  2. same size of next page
  3. custom page size

Compression/file size when saving not optimal

Example

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!

So?

I guess this is just some bad compression or so.
In any case, this should possibly not happen…

Accept translations using Weblate

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.

SRP violation.

window->openDocument(file);

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)

Crashes with a certain pdf

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 for this application if useful to your development efforts

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.

[Feature request] Utilize QPDF as backend instead of PDF-Writer

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.

[Feature request] Add ability to delete page(s)

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.

Choose a license

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.