Menu

#214 Copy/paste/duplicate a page

open
nobody
None
5
2020-10-21
2017-01-10
No

Hello,

I'm using Xournal to make beamer-like presentations (see for example http://lipn.univ-paris13.fr/~courtiel/slides/irif_weighted_walks.pdf ), which is great.

It would save me a lot of time if it was possible to cut/copy/paste/duplicate a page. In other words, I'd like a new feature which copies everything on a page (layer + background), and paste it at the same exact absolute position.

The main problem now is when I select and copy everything which is on my page, create a new one, paste it, then the selection will be automatically centered, which is annoying if you want to make smooth transitions between pages. The only solution I imagined so far is to put at the top left corner and bottom right corner some blots which have the same colour as the background, which is a bit tedious.

Is there anyway to solve this problem?

Thanks a lot,
Julien Courtiel.

Discussion

  • The Compiler

    The Compiler - 2017-01-10

    FWIW you can duplicate a page by setting "new pages keep background" and then add a new page - however I guess this is not really ideal for your usecase.

    On a related note, I'd really like a way to select/copy something from the background layer and copy/paste it to layer 1 on the next page (so I can copy/paste e.g. mathematical terms given in an exercise to the next page where I solve it (with the graph background)

     
    • Denis Auroux

      Denis Auroux - 2017-01-12
      • On the original post: copy-pasting / duplicating a whole page: yes
        this is a missing feature. Should be done sometime, just not sure what
        the user interface should be (especially since one might want to copy
        just a layer or all the layers). In the meantime, with a text editor you
        can always duplicate the entire <page>...</page> section in the
        decompressed (gunzip) xoj file (not a practical way to proceed, I
        know...). (The exception is page 1 of the pdf, you need to delete the
        "filename" and "domain" attributes of the <background> section from the
        duplicated page.)

      • Comment about duplicating by "new pages keep background" + add a new
        page: this only duplicates the background, not the layers drawn over it.
        The question is how to duplicate both. Right now there is no good solution.

      • Copy-paste from background to layer 1: not possible in a meaningful
        way with the current architecture, since background typically is a whole
        PDF page that xournal does not really know the contents of (it is simply
        displayed by poppler when needed), while other layers contain pen
        strokes, text items, and bitmap images. One could always render a
        portion of background as a bitmap and paste it somewhere else... but
        then you might as well do it using a screenshot utility to copy the
        portion of page into the clipboard, then paste into xournal. (If you are
        using gnome, Ctrl+Shift+Printscreen will let you select a portion of the
        display and copy it into the clipboard; then Ctrl+V in xournal inserts
        that wherever you need it. The only drawback is that the bitmap is
        rendered at the resolution of the current view, rather than at a fixed
        high resolution).

      Denis

       
  • Dr.Beco

    Dr.Beco - 2020-10-21

    Thanks for this awesome suggestion.

    Sometimes I write a page with tables and other useful information that I will cover during a video, increasingly from one page to the next, and it would be really helpful if I could duplicate a page.

    My best.

     
    • Denis Auroux

      Denis Auroux - 2020-10-21

      This would indeed be useful, but due to lack of time I doubt I'll be
      able to implement this anytime soon, at least not in the way it should
      ideally work.

      Two things I can imagine implementing sooner, in that order:
      1. a way to select the whole current layer; this should be pretty easy,
      and if set up properly, it should already paste without any change of
      position when copied to a page with the same paper size. This ought to
      work across documents.
      2. a way to duplicate the current page (with all its layers) inside the
      document, and a way to move the current page to the end of the document.

      A graphical interface other than menu entries for such manipulations is
      not going to happen anytime soon, and neither is a mechanism for really
      copying pages (rather than layers) into the clipboard and across
      different xournal documents. (I believe that the forked project
      xournal++ may have these features, on the other hand).

      In the meantime: xournal documents are gzipped text files so you can
      duplicate pages by hand -- rename the .xoj to file.xoj.gz, gunzip
      file.xoj.gz to make a plaintext .xoj file, then open the .xoj in a text
      editor. Locate a whole <page> ... </page> section and duplicate it as
      needed. (This does not quite work with the first page of a xoj document
      that has a PDF file as background, because of how the PDF background is
      shared across pages of the xoj and specified differently on subsequent
      pages). Save, and reopen in xournal. PLEASE PLEASE PLEASE always keep a
      backup copy of your .xoj when editing it manually in this way, because
      xournal will not help you in any way if the changes you made are deemed
      invalid, you'll just get an unhelpful error message.

      A similar trick: if you have two xoj documents (or more), among which at
      most one annotates any pdf background, you can just merge them: cat
      file1.xoj file2.xoj > file.xoj.
      So to make 3 copies of a single-page xoj document, you could just do cat
      file.xoj file.xoj file.xoj > file3.xoj

      One more piece of advice about uncovering page elements, since giving
      presentations where material gradually uncovers itself is one of the
      main use cases: layers can be used to show things in successive
      installments (show/hide layer), bringing more and more items of the page
      into visibility, though for a presentation an unfortunate feature of
      xournal is that when arriving at a new page it always starts with all
      layers shown, so you'd need to briefly show everything, manually return
      to layer 1 then re-show the successive layers over it. The way I have
      uncovered things, instead, is using two layers: layer 1 contains the
      whole content. Then on layer 2, I have some very thick white pen or
      thick white highlighter strokes that cover the portions of the text.
      When giving the presentation, I am on layer 2, and the eraser tool is in
      "delete strokes" mode; by erasing the white blob over a part of layer 1,
      I can then make it appear in one click. The advantage of this over
      multiple pages is that any handwritten annotations I make on layer 2
      remain visible as I uncover more of layer 1 using the eraser to remove
      the whiteout.

      Hope this helps.
      Denis

       

Log in to post a comment.