Cimbali / pympress

Pympress is a simple yet powerful PDF reader designed for dual-screen presentations
https://cimbali.github.io/pympress/
GNU General Public License v2.0
1.17k stars 89 forks source link

Support libreoffice notes pages #171

Closed hyiltiz closed 3 years ago

hyiltiz commented 4 years ago

When I use Export As PDF from within Libreoffice Impress on a .odp file, I have an option about notes: Export notes pages and Comments as PDF annotations. image

The former simply appends the same set of slides once more (so the total number of slide pages exported is twice of the original) with tall slides with the other half having the notes (see below). The latter option is irrelevant to presenter notes. Screenshot_20201021_003406

That simply doesn't work with presenting with the PDF. Is there a workaround? I think any of the following would work:

I am inclined to go with the last option for now, but not sure what fields to edit for the slide notes to show up properly. Suppose I create a 5 page slides using Libreoffice Impress where slide 3 and 4 has presenter notes "note 3" and "note 4" respectively. If I create a text file containing the following:


note 3
note 4

How can I call qpdf such that I can embed the notes into my PDF in order for pympress to recognize and show them as the presenter notes?

I tested with Okular some PDF comments and it seems creating any kind of PDF annotation with text (I tested the popup annotation and text annotation) works -- they showed up in pyimpress as presenter notes without showing up on the slides.

Cimbali commented 3 years ago

Hi @hyiltiz and thanks for opening this issue, this is a very interesting suggestion !

I think the 2 options from libreoffice are probably those we should work with:

  1. Export notes pages [which] appends the same set of slides once more (so the total number of slide pages exported is twice of the original) with tall slides with the other half having the notes

    We could try and detect pages of different aspect ratios, alternating odds and even pages, if I understood this right. Then either remove the top part (which repeats the slide) or only show this page in the presenter view.

  2. Comments as PDF annotations

    These could/should show up as annotations in pympress, and is what you saw with the Okular PDF comments. But maybe comments and notes are not the same things inside libreoffice ?

In any case I need to have a deeper look, but I think supporting libreoffice PDF outputs out of the box is a good idea. I’m not very fond of the approach of having a second file that contains notes in general.

hyiltiz commented 3 years ago

Thx for the response! Responding inline.

Hi @hyiltiz and thanks for opening this issue, this is a very interesting suggestion !

I think the 2 options from libreoffice are probably those we should work with:

  1. Export notes pages [which] appends the same set of slides once more (so the total number of slide pages exported is twice of the original) with tall slides with the other half having the notes

    We could try and detect pages of different aspect ratios, alternating odds and even pages, if I understood this right. Then either remove the top part (which repeats the slide) or only show this page in the presenter view. This would be most ideal, since this requires nothing to be done by the user nor the libreoffice developers; getting text out from a few pages should also be possible without too much programming.

The extra pages are simply appended, with tall aspect ratio. So if the original slide pages are ordered as [1,2,3,4,5], the ones with comments are [1,2,3,4,5,1',2',3',4',5'], where 3' is the same as 3 except it is twice as tall as 3 and includes the presenter notes in the bottom half, below the actual slides.

  1. Comments as PDF annotations

    These could/should show up as annotations in pympress, and is what you saw with the Okular PDF comments. But maybe comments and notes are not the same things inside libreoffice ?

Yeah, manually creating annotations in Okular worked nicely with pympress but libreoffice didn't create annotations. I think, it converts libreoffice comments, like the ones used during a collaborative editing process you could give feedback on part of the document in libreoffice, to PDF annotations. However, presenter notes are not converted to annotations, but instead just appended at the end of the pdf file as described above.

In any case I need to have a deeper look, but I think supporting libreoffice PDF outputs out of the box is a good idea. I’m not very fond of the approach of having a second file that contains notes in general.

Really glad to hear the support; I am more than happy to provide testing etc. Ideally, as early as we can, since I would like to be able to use pympress for my dissertation defense talk soon (within weeks) ;-p I agree that an external file that only contains the presenter notes is hacky.

I created a test slides. It contains only 5 pages. Slide 3 and 4 has notes. Slide 2 has "libreoffice comments", but not notes; this should not be converted into presenter notes. However, pympress currently renders these libreoffice comments as presenter notes, and completely ignores the actual presenter notes. Try out with the following file(s). Libreoffice odp file: http://ix.io/2BFV Exported PDF: http://ix.io/2BFW

Cimbali commented 3 years ago

The comments-to-PDF seem to work:

image

You maybe need to press a to toggle the annotations panel if it’s not opened by default.

Cimbali commented 3 years ago

Alright, and in Libreoffice you can change the format and orientation of the notes pages, by going into the « Properties » panel. See here on the right, I’ve changed the notes to be in A4 but landscape orientation.

image

What this means is that we can simply detect when we have half the slides with a given aspect ratio, followed by the other half of the slides with a different aspect ratio. Then we should engage « Libreoffice notes pages » mode, which means:

I think maybe the annotation panel should be kept toggleable.

hyiltiz commented 3 years ago

Yes, you are right; the comments-to-PDF show up as presenter notes. That is not how it should be though; comments-to-PDF usually come from libreoffice collaborative editing, which is not the presenter notes. I'd want presenter notes on only slides 3/5 and 4/5.

Cimbali commented 3 years ago

comments-to-PDF usually come from libreoffice collaborative editing, which is not the presenter notes.

I agree that it’s not what they’re designed for, but they can serve as a workaround if needed.

hyiltiz commented 3 years ago

comments-to-PDF usually come from libreoffice collaborative editing, which is not the presenter notes.

I agree that it’s not what they’re designed for, but they can serve as a workaround if needed.

Yes.

I think your "Libreoffice notes pages mode" idea is great; I do not know much about the internals of the pympress to estimate if that would be a large rewrite or a simple addition of a few functions.

Cimbali commented 3 years ago

It’s less work than re-doing the drawing tools, that’s for sure. :)

Cimbali commented 3 years ago

Alright, you can test the current master @hyiltiz. Not sure I haven’t let some bug slip through, but I’ve tested it and it seems to work.

It should auto-detect, otherwise you can

If you want to change the way the notes pages look however that’s entirey in Libreoffice, including their aspect ratio etc.

hyiltiz commented 3 years ago

Just created a virtualenv and installed the master, along with a few dependencies. Works wonderfully! Thanks! This is probably much better than trying to extract text out from half the page somewhere and pretend them being PDF annotations. More "native" support. :+1: