feature request: copy/paste within pdf

  • miki obradovic

    miki obradovic - 2011-05-30


    i love xournal, and have been using it for years now. i have a thinkpad tablet and have started using it for doing my calculations on my screen. it works great and i am very greatful.

    what i am missing is a feature which would allow my to not only annotate pdfs, but also allow me to copy and paste parts of the pdf to an other place in the document.

    usage scenario: i am reading a physics paper. there is a formula i want to check. i draw the selection rectangle around it, click on copy. i create a new page at the end of the document. i paste the formula and use it as a local reference to base my calculation on.

    thank you guys!

  • Denis Auroux

    Denis Auroux - 2011-05-30

    It'd be very hard to implement this as a manipulation on PDF objects (it'd become a full-featured PDF editor, which is well beyond what xournal understands of the PDF format). On the other hand, one could imagine copy-pasting bitmap renderings of pieces of the PDF. This is something that will be best done in the upcoming xournal++, since it includes support for image objects from the start. It is still far from trivial (especially in terms of figuring out a mechanism for the user interface - maybe this be a special mode of the selection tool? e.g., perhaps this happens when one uses the selection tool on the background layer instead of on the normal drawing layer ??)

    In any case, thanks for the interesting suggestion, but not sure it'll be possible to implement it anytime soon…


  • miki obradovic

    miki obradovic - 2011-05-30

    i don't use layers at all, i have an idea of how to simply implement it - use imagemagicks import function - do you know it?
    i use it for snapshots and could use it now for doing what i wan to do like so:

    1) execute "import /home/username/screenshot.png" - the cursor changes into a selection tool
    2) select the portion of the screen that you want in the image


    now, that should be easy enough to harvest from within xournal - no? here is how it might work:

    1) UI button - executes "import /some/good/folder/xournal_sh.png"
    2) user selects the area he wants to copy
    at this point the control is given back to xournal
    3) xournal recognises that it has back the control and loads that picture into it's memore
    4) on the next paste it is pasted into the document

    that should work - no? it would also allow to copy/paste anything from anywhere into xournal..


  • Denis Auroux

    Denis Auroux - 2011-05-31

    What you propose is different - you propose a screenshot, which is not the same as what the original request asked for. For example, a bitmap screenshot will not get smoothed when you zoom in (it stays at a fixed resolution), while PDF is vector graphics and gets rendered differently at different zoom levels. But indeed, what would be feasible relatively easily is a bitmap copy-paste rather than as actual PDF vector objects.

    Another difference is logical - is what we copy part of the screen or part of the document we're working on? (e.g., shouldn't I be able to select part of the document that is outside of the xournal window? This is an important difference - the selection rectangle behaves in a different manner if you're doing a selection within the document or a screenshot (think of what happens when you move the cursor outside of the xournal window while selecting: in one case the selection extends into the invisible part of the document, in the other case it extends onto the desktop and other windows).

    Now, for screenshots: xournal already knows how to take screenshots, there's no need to use ImageMagick or any other external tool. (See the Journal -> Background Screenshot command). All that would change is that one selects a rectangle with a click-and-drag instead of selecting a whole window with a single click (and also the result comes as an image object on the document, instead of as a page background).

    My interrogations about the user interface were: should this be a special feature of the "select rectangle" tool? or a mode of the "screenshot" command? or yet something else? Those will be decisions for whoever implements it in the end…




Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks