Friday, July 24, 2009

PDF Mod

On Monday I started working on a new app, PDF Mod, for doing simple manipulations to PDF files. Five days later, I'm proud to present it to you: It can rotate, extract, and remove pages, and supports reordering pages via drag and drop. Visit the project wiki for links to the git repo, tarball and package downloading, user guides, bugzilla, the mailing list, irc, and more. There are likely some bugs, but in my testing it is quite useful and slick already. It's built on top of libpoppler/poppler-sharp, PdfSharp, Gtk#/Cairo, and Banshee's Hyena library. The app itself is a paltry 2009 lines of .cs files. It is super easy to build and run uninstalled from the tarball if you want to give it a spin: ./configure && make && make run Looking forward to your feedback, either in the comments, @gabaug on twitter, or find my e-mail address in the code or on my blog. Is this something that should have a presence on GNOME git/bugzilla/wiki? Update: PDF Mod is now fully hosted on GNOME's infrastructure. See our wiki for links to download, source repo, mailing list, bugzilla, etc.

36 comments:

  1. I suggest getting this code integrated with scribus or evince asap. It could be /very/ handy indeed, but mainly in combination with another piece of software people are already more likely to have, maybe as a plugin or something.

    ReplyDelete
  2. I can't believe how much you can do in a week! Truly amazing.

    ReplyDelete
  3. It seemed a cool hack until the point I realized it is in Mono. I can't express any interest on that.

    ReplyDelete
  4. Will this anti-mono crap ever end? I'm sick of hearing about it. If you're not interested, don't comment! For a bunch of people that aren't interested in Mono-based software, you guys sure do seem vocal about it.

    I'm sick of seeing this division in our community. I don't like KDE software, but I don't read KDE blogs and tell people how much I don't like their software. It's pointless and counter-productive.

    ReplyDelete
  5. @Ethan: I think it works well as a standalone app, following the Unix philosophy of small, simple tools. I don't plan to try to merge them, though you're of course welcome to.

    @jimmac: thanks :) can still use an icon

    @anon1: it's still a cool hack, you're just blind

    @anon2: thanks for setting @anon1 straight :)

    ReplyDelete
  6. @Gabriel: No problem. I forgot to mention how cool this is. I do a lot of scanning in xsane (trying to be paperless) and have always wanted nice little tool to reorder pages and stuff. Will this allow me to rename the title of the document? Stuff scanned in xsane always shows "XSane Scanned Document" in the title bar of Evince.

    Anyway, nice work ;)

    ReplyDelete
  7. @anon2: thanks :) Yeah, I plan to add basic metadata editing

    ReplyDelete
  8. I fully agree with Ethan. I posted a similar request for Evince some time ago, in fact:

    https://bugzilla.gnome.org/show_bug.cgi?id=492352

    I think all the functionality shown in the screenshots could be available by right-clicking the thumbnails in Evince's left pane, and you wouldn't have to install a specific app for such basic operations.

    ReplyDelete
  9. It indeed looks great. If GNOME would have a basic PDF editor included by default it would have something unique.
    What is libhyena about, by the way?

    However, I do think that it would be better to integrate it with existing viewers. Considering this is written in Mono, it's probably hard to do, if not impossible if you don't rewrite.

    So maybe the best solution would be to make this tool a viewer as well.

    ReplyDelete
  10. congrats!


    I was using PDFShuffler until now (pretty close, but Python).

    Could you add basic Meta-Data Editing? Title, Author, etc.?

    ReplyDelete
  11. Sorry 'very easy to build'?

    I carnt figure out how to get /clone the git sources

    git clone https://gitorious.org/pdfmod

    or various mods get me nowhere. The web interface doesn't tell me the obvious command(s)

    Using the tarball, I get a torrent of 'successfull' messages, however something is still failing in there. I tried installing dependencies you mentioned, but I can only figure out on debian:

    libcairo-dev libpoppler-dev libpdflib804-dev

    ReplyDelete
  12. may i ask wich gtk themes and windows decoration are shown in the screenshots?

    ReplyDelete
  13. @Amber:
    On the page you provided the command 'git clone git://gitorious.org/pdfmod/pdfmod.git' is given as the one to obtain the latest source code. You could try that.

    ReplyDelete
  14. Is it possible to remove margins from pdf files with this tool?

    I really need it. Ony my Sony prs-505 the zoom button just increases the font size.

    Many times I have a pdf with wide margins, because it was made to be printed and not to be read on a 6 inches screen.

    ReplyDelete
  15. @anonymous: The theme is shiki colors: https://www.gnome-look.org/content/show.php/Shiki-Colors?content=86717

    ReplyDelete
  16. Excellent work, an easy-to-use pdf editor is a major missing feature for GNOME :-)

    As an aside, I'd like to mention that I was all set to download and use this app. Till I realized it was mono.

    You must be thinking "*groan* not another mono troll" :p

    But no, the reason why I can't use your wonderful creation is because with my low-memory system, I can't handle more than one VM in-memory, and Python has that honour.

    But hey! To each his own :)

    ReplyDelete
  17. Excellent work!! Congratulations.

    It would be great if double clicking a page would zoom it or open it in evince. Documents have lots of similar pages, so it's better checking what you are removing...

    ReplyDelete
  18. Hello! Great work!
    Adding to this some basic editing function (add text/image/underline etc...) will make my day! :D

    ReplyDelete
  19. @bheekling Certainly it can be frustrating being in a memory-constrained environment. But you do realize that Mono consumes 0 memory when you're not using it, right?

    If you have a few megs to spare during the time when you're actually editing a PDF, this tool should work just fine for you.

    Simply having it installed will not make your memory disappear, so it's safe to try it out. :-)

    Of course, if there's another graphical PDF editing tool available for Linux that suits your requirements better, by all means use it! And share your findings with others; I haven't come across any such tools until now.

    ReplyDelete
  20. @Amber Please share the specific configure/build errors you're experiencing. If you can copy the complete output of `./configure && make` to a pastebin site, and share the URL here, I'm sure we can help you figure out what you need. :-)

    ReplyDelete
  21. Awesome! :) Any chance for merging PFDs as well? Like just importing a second PDF and rearranging the pages.

    ReplyDelete
  22. @Hylke In the latest git version, if you have a PDF open in pdfmod, you can drag in another PDF from Nautilus, and the dragged PDF will be inserted wherever you drop it.

    ReplyDelete
  23. Just want my voice to the "Awesome"
    This app look really nice and provides much needed functionalities

    ReplyDelete
  24. Great idea and tool!
    Do you have any plan about, split, merge, and insert pages?
    And about edit text on page?
    Good luky ...

    ReplyDelete
  25. While you're waiting for something like this to be further along in development, you may want to try this web based free PDF editor.

    It can edit PDF files and many of the aspects them in Gnome (online) this project can't yet.

    ReplyDelete
  26. The main tool I use in Windows is the full version of Acrobat to crop scanned book pages. Can you add cropping pages?

    ReplyDelete
  27. Can you give any advice on installing this on Ubuntu? I think I'm missing some packages (gmcs I think)

    THanks!

    ReplyDelete
  28. Cropping (and OCR!) is probably the main tool I use for editing a pdf (besides annotation mark up). Why is there no linux program that offers cropping is a relatively simple GUI?

    Nice work, but unfortunately not very useful for me.

    ReplyDelete
  29. Won't configure on Fedora 10 unfortunately, complains about intltool: "configure: error: Your intltool is too old. You need intltool 0.35.0 or later." Love to see RPMs for this.

    adam

    ReplyDelete
  30. I'll build and install tonight. I'm glad to see more contenders in this area. I've been using gscan2pdf for a couple of years and it has been improving nicely. It doesn't have a true editor in it (you can reorder pages, import from other documents, etc) but it does have a context menu link to bring up GIMP to fully edit then save back in place. OCR is not great but I understand that is due to the lack of a good open-source OCR package. Adobe is hard to be there.

    ReplyDelete
  31. Great tool. Some simple annotation of the text and adding notes, would make this app even cooler!

    ReplyDelete
  32. (1) Great work. Very well done in a minimalist way. I have been using pdfsam, PDF Split and Merge but I might have to make a switch.

    pdfsam is Java (again, a memory managed environment which permits fairly rapid development, useful GUI support out of the box, the like, at some non-zero cost of space and time).

    (2) As long as everyone is posting suggestions, perhaps a way to select based on TOC divisions? I have a 400+ page book and the publisher likes getting the chapters burst apart. I would be happy to do so but pdfsam has started losing its mind on split (not sure if embedded pdf images are making it baulky).

    So, if I could select Chapter02 (or the like), that would be cool. Of course I don't have time to help out on the project so I am just another moocher trying to get something for nothing.

    (3) No matter what, the project is well worth my costs. Thanks for sharing.

    ReplyDelete
  33. Wow, looks nice. I'll be sure to try it once I upgrade Jaunty -> Karmic

    ReplyDelete
  34. I am having trouble getting pdfmod to compile. It stops at hyena with a no package found error. I have downloaded hyena, ran ./configure && make && make install but still no go. I have even taken the bin directory files and added them to pdfmod's lib directory. I have also copied hyena-0.1 directory into the lib directory and run ./configure and still no go.

    I do not know how to change the Environment variable to circumvent this error message. What can I do to get pdfmod to find and use hyena within my fedora 11 distro?

    ReplyDelete
  35. Some instructions on how to get poppler-sharp binding built? Using jacintos setup, ubuntu 9.10 its griping about Poppler.Action not inherting type GLib and subsequently gmcs going over generated cs files spits out "The name 'Handle' does not exist in the current content" and "Cannot convert type 'GLib.Object' to 'Poppler.Action' via a built-in conversion.

    ReplyDelete