Skip to content

Commit

Permalink
Revert to using render() instead of render_for_printing_with_options() (
Browse files Browse the repository at this point in the history
#344)

Revert to using render() instead of render_for_printing_with_options()
to avoid inferior quality of Cairo rendering in this mode. To prevent
displaying PDF annotations, remove the programmatically.

Add version dependency:
PopplerPage.remove_anot() is available since 0.22
  • Loading branch information
fnevgeny authored and AndreasBilke committed May 7, 2018
1 parent 15b9cea commit 13e3b37
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ find_package(PkgConfig)
pkg_check_modules(GOBJECT REQUIRED gobject-2.0)
pkg_check_modules(GIO REQUIRED gio-2.0)
pkg_check_modules(GEE REQUIRED gee-0.8)
pkg_check_modules(POPPLER REQUIRED poppler-glib)
pkg_check_modules(POPPLER REQUIRED poppler-glib>=0.22)
pkg_check_modules(GTK REQUIRED gtk+-3.0>=3.10)
list (FIND GTK_STATIC_LIBRARIES "X11" _index)
if (${_index} GREATER -1)
Expand Down
2 changes: 2 additions & 0 deletions src/classes/metadata/pdf.vala
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,8 @@ namespace pdfpc.Metadata {
note_text += a.get_contents();
break;
}
// Remove the annotation to avoid its rendering
page.remove_annot(a);
}
if (note_text != "") {
this.notes.set_note(note_text, user_slide, true);
Expand Down
3 changes: 1 addition & 2 deletions src/classes/renderer/pdf.vala
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,7 @@ namespace pdfpc {
cr.scale(this.scaling_factor, this.scaling_factor);
cr.translate(-metadata.get_horizontal_offset(this.area),
-metadata.get_vertical_offset(this.area));
page.render_for_printing_with_options(cr,
Poppler.PrintFlags.DOCUMENT);
page.render(cr);

// If the cache is enabled store the newly rendered pixmap
if (this.cache != null) {
Expand Down

0 comments on commit 13e3b37

Please sign in to comment.