Skip to content

New .pdfpc format #556

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Dec 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,13 @@ In order to compile and run pdfpc, the following requirements need to be met:
- gstreamer >= 1.0 with gst-plugins-good
- discount (aka markdown2)
- webkit2gtk
- json-glib

E.g., on Ubuntu 18.04 onward, you can install these dependencies with::

sudo apt-get install cmake valac libgee-0.8-dev libpoppler-glib-dev
libgtk-3-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev
libmarkdown2-dev libwebkit2gtk-4.0-dev gstreamer1.0-gtk3
libjson-glib-dev libmarkdown2-dev libwebkit2gtk-4.0-dev gstreamer1.0-gtk3

(the last one is a run-time dependence). You should also consider installing all
plugins to support required video formats; chances are they are already present
Expand Down
8 changes: 4 additions & 4 deletions demo/pdfpc-demo.tex
Original file line number Diff line number Diff line change
Expand Up @@ -363,12 +363,12 @@
\frametitle{\opt{.pdfpc} files}
\begin{itemize}
\item The additional information needed for the presentation (duration,
notes, end slide, etc.) is stored in an additional file with extension
notes, end slide, etc.) is stored in an auxiliary file with extension
\opt{.pdfpc}
\item Most of the time this file is automatically handled
\item If you ever need to do changes by hand (e.g.\ if you modify the PDF
after defining the meta-information) it is a text-based format easy to
edit
\item If you ever need to do changes by hand (e.g., if you modify the PDF
after defining the meta-information), it is a text-based format (JSON)
easy to edit
\end{itemize}
\end{frame}

Expand Down
4 changes: 2 additions & 2 deletions latex/pdfpc/pdfpc.sty
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,9 @@ ______<rdf:Description xmlns:pdfpc="https://github.com/pdfpc/pdfpc">^^J%
\hyxmp@add@simple{pdfpc:LastMinutes}{\PDFPC@lastminutes}%
\hyxmp@add@simple{pdfpc:NotesPosition}{\PDFPC@notesposition}%
\ifPDFPC@disablemarkdown%
\hyxmp@add@simple{pdfpc:EnableMarkdown}{false}%
\hyxmp@add@simple{pdfpc:DisableMarkdown}{true}%
\else%
\hyxmp@add@simple{pdfpc:EnableMarkdown}{true}%
\hyxmp@add@simple{pdfpc:DisableMarkdown}{false}%
\fi
\hyxmp@add@simple{pdfpc:DefaultTransition}{\PDFPC@defaulttransition}%
\hyxmp@add@to@xml{%
Expand Down
68 changes: 26 additions & 42 deletions man/pdfpc.in
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ presentation.
.BI "\-e, \-\-end\-time"=T
End time of the presentation. (Format: HH:MM (24h))
.TP
.BI "\-f, \-\-note\-format"=FORMAT
Enforce format of notes (plain or markdown. Default: markdown)
.TP
.BI "\-g, \-\-disable\-auto\-grouping"
Disable auto detection of overlay groups. (Default: enabled)
.TP
Expand Down Expand Up @@ -337,20 +340,21 @@ many minutes you are overtime.
.SS Notes

.PP
Textual notes can be displayed for each slide. A few types of PDF annotations
are understood by pdfpc and will be automatically imported and displayed (only
their textual content, no formatting attributes are preserved). The PDF
annotations can be made using many PDF editors and even viewers. These "native"
PDF notes cannot be edited in pdfpc.
Textual notes can be displayed for each slide. pdfpc understands the Markdown
syntax, which allows for rendering anything from plain text to a very rich
formatting, if so desired. A few types of PDF annotations are understood by
pdfpc and will be automatically imported and displayed. The PDF annotations can
be made using many PDF editors and even viewers; when using LaTeX, the
\fBpdfpc\fR package (see below) provides a convenient macro. These "native" PDF
notes cannot be edited in pdfpc.
.PP
In addition, while in the presentation mode, pressing \[aq]Ctrl + n\[aq] will allow you
to take notes for the current user slide. To exit the note editing mode, press
the Escape key. Note that while editing a note, the keybindings stop working,
i.e. you are not able to change slides. These notes are stored in the .pdfpc
file in a plain text format, easy to edit also from outside the program; see
the section about the pdfpc format below. These notes take precedence over the
native PDF annotations, i.e., if a user-proveded note exists for a given slide,
any PDF annotations on that page will be silently ignored.
In addition, while in the presentation mode, pressing \[aq]Ctrl + n\[aq] will
allow you to take or edit notes for the current user slide. To exit the note
editing mode, press the Escape key. These notes are stored in the .pdfpc file.
They take precedence over the native PDF annotations, i.e., if a user-provided
note exists for a given slide, any PDF annotations on that page will be silently
ignored. While editing a note, the normal keybindings are disabled, e.g., you
are not able to change slides.
.PP
Although mixing the
two types of notes is possible, for a given presentation one will likely want to
Expand Down Expand Up @@ -528,13 +532,14 @@ full setup at the computer in advance.

.SS pdfpc files
.PP
Some additional information is stored in a file with the extension
"pdfpc". When pdfpc is invoked with a PDF file, it automatically checks for
and loads the associated .pdfpc file, if it exists. This means that you
normally do not have to deal with this kind of files explicitly.
Notes, user-defined overlays, and some additional information is stored in a
file with extension "pdfpc". When pdfpc is invoked with a PDF file, it
automatically checks for and loads the associated .pdfpc file, if it exists.
This means that you normally do not have to deal with this kind of files
explicitly.
.PP
Beside internal configuration, the following command-line
options are stored within the pdfpc file for later usage:
Beside internal configuration, the following command-line options are saved in
the pdfpc file for later usage:

.IP \[bu] 2
duration
Expand All @@ -545,30 +550,9 @@ last_minutes
.IP \[bu] 2
notes (position)
.IP \[bu] 2
start_time

.PP
There are, however, cases where you may want to edit this file manually.
The most typical case is if you add or remove some slides after you have
edited notes or defined overlays.
It may be quicker to edit the pdfpc file than to re-enter the whole
information.

.PP
There is also the possibility of including notes from a different file.
If pdfpc encounters a [notes_include] section with the .pdfpc file
it reads the notes
.B
only
from the included file. Changing notes within pdfpc is then forbidden.

.PP
The files are plain-text files that should be fairly self-explanatory.
A couple of things to note:
.IP \[bu] 2
The slide numbers of the notes refer to user slides
page_transition
.IP \[bu] 2
Slide indexes start at 1
start_time

.SS Appearance

Expand Down
5 changes: 5 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ pkg_check_modules(POPPLER REQUIRED poppler-glib>=0.22)
pkg_check_modules(GTK REQUIRED gtk+-3.0>=3.22)
pkg_check_modules(WEBKIT REQUIRED webkit2gtk-4.0)
pkg_check_modules(MARKDOWN REQUIRED libmarkdown)
pkg_check_modules(JSON REQUIRED json-glib-1.0)
list (FIND GTK_STATIC_LIBRARIES "X11" _index)
if (${_index} GREATER -1)
set(WITH_X11 1)
Expand Down Expand Up @@ -46,6 +47,7 @@ include_directories(
${GSTVIDEO_INCLUDE_DIRS}
${WEBKIT_INCLUDE_DIRS}
${MARKDOWN_INCLUDE_DIRS}
${JSON_INCLUDE_DIRS}
${CMAKE_CURRENT_SOURCE_DIR}
)

Expand All @@ -62,6 +64,7 @@ link_directories(
${GSTVIDEO_LIBRARY_DIRS}
${WEBKIT_LIBRARY_DIRS}
${MARKDOWN_LIBRARY_DIRS}
${JSON_LIBRARY_DIRS}
)

if(${WITH_X11})
Expand Down Expand Up @@ -106,6 +109,7 @@ vala_precompile(VALA_C
${VALA_SRC}
PACKAGES
webkit2gtk-4.0
json-glib-1.0
gio-2.0
gee-0.8
poppler-glib
Expand Down Expand Up @@ -137,6 +141,7 @@ target_link_libraries(pdfpc
${POPPLER_LIBRARIES}
${MARKDOWN_LIBRARIES}
${WEBKIT_LIBRARIES}
${JSON_LIBRARIES}
${GTK_LIBRARIES}
${GTHREAD_LIBRARIES}
${PANGOCAIRO_LIBRARIES}
Expand Down
5 changes: 4 additions & 1 deletion src/classes/config_file_reader.vala
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,10 @@ namespace pdfpc {
Options.transition_fps = int.parse(fields[2]);
break;
case "windowed-mode":
Options.windowed = fields[2];
// don't override command-line setting
if (Options.windowed == null) {
Options.windowed = fields[2];
}
break;
default:
GLib.printerr("Unknown option %s in pdfpcrc\n", fields[1]);
Expand Down
3 changes: 1 addition & 2 deletions src/classes/dbus_server.vala
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,8 @@ namespace pdfpc {
}

public string get_notes() throws GLib.Error {
var notes = this.controller.metadata.get_notes();
return
notes.get_note_for_slide(controller.current_user_slide_number);
this.controller.metadata.get_note(controller.current_slide_number);
}
}
}
Loading