#include "printing.h"
#include "prefs_common.h"
#include "gtk/gtkutils.h"
+#include "gtk/inputdialog.h"
#include "mimeview.h"
#ifndef POPPLER_WITH_GDK
#include "stdbool.h"
GError *error = NULL;
gchar *tmpfile = NULL;
gchar *tmp;
+ gchar *password = NULL;
debug_print("pdf_viewer_update\n");
else {
viewer->pdf_doc = poppler_document_new_from_file( viewer->fsname, NULL, &error);
}
+ if (error && g_error_matches(error, POPPLER_ERROR, POPPLER_ERROR_ENCRYPTED)) {
+ g_clear_error(&error);
+ password = input_dialog_with_invisible(_("Enter password"),
+ _("This document is locked and requires a password before it can be opened."),
+ "");
+ viewer->pdf_doc = poppler_document_new_from_file(viewer->fsname, password, &error);
+ g_free(password);
+ }
viewer->num_pages = poppler_document_get_n_pages(viewer->pdf_doc);