9013c9
--- a/backend/pdf/ev-poppler.cc
9013c9
+++ b/backend/pdf/ev-poppler.cc
9013c9
@@ -1037,6 +1037,7 @@ pdf_document_get_info (EvDocument *document)
9013c9
 	PopplerPermissions permissions;
9013c9
 	char *metadata;
9013c9
 	gboolean linearized;
9013c9
+	PopplerPrintScaling print_scaling;
9013c9
 
9013c9
 	info = g_new0 (EvDocumentInfo, 1);
9013c9
 
9013c9
@@ -1068,6 +1069,7 @@ pdf_document_get_info (EvDocument *document)
9013c9
 		      "page-mode", &mode,
9013c9
 		      "page-layout", &layout,
9013c9
 		      "viewer-preferences", &view_prefs,
9013c9
+		      "print-scaling", &print_scaling,
9013c9
 		      "permissions", &permissions,
9013c9
 		      "creator", &(info->creator),
9013c9
 		      "producer", &(info->producer),
9013c9
@@ -1160,6 +1162,20 @@ pdf_document_get_info (EvDocument *document)
9013c9
 		info->ui_hints |=  EV_DOCUMENT_UI_HINT_DIRECTION_RTL;
9013c9
 	}
9013c9
 
9013c9
+       /*
9013c9
+        * Save the PrintScaling preference in the bit field
9013c9
+        * so we don't need to modify EvDocumentInfo type downstream
9013c9
+        */
9013c9
+	switch (print_scaling) {
9013c9
+		default:
9013c9
+		case POPPLER_PRINT_SCALING_APP_DEFAULT:
9013c9
+			info->ui_hints &= ~(1 << 30);
9013c9
+			break;
9013c9
+		case POPPLER_PRINT_SCALING_NONE:
9013c9
+			info->ui_hints |= 1 << 30;
9013c9
+			break;
9013c9
+	}
9013c9
+
9013c9
 	info->permissions = 0;
9013c9
 	if (permissions & POPPLER_PERMISSIONS_OK_TO_PRINT) {
9013c9
 		info->permissions |= EV_DOCUMENT_PERMISSIONS_OK_TO_PRINT;
9013c9
--- a/libview/ev-print-operation.c
9013c9
+++ b/libview/ev-print-operation.c
9013c9
@@ -1953,9 +1953,14 @@ ev_print_operation_print_create_custom_widget (EvPrintOperationPrint *print,
9013c9
 	EvPrintScale      page_scale;
9013c9
 	gboolean          autorotate;
9013c9
 	gboolean          use_source_size;
9013c9
+	EvDocumentInfo   *info;
9013c9
 
9013c9
 	settings = gtk_print_operation_get_print_settings (print->op);
9013c9
-	page_scale = gtk_print_settings_get_int_with_default (settings, EV_PRINT_SETTING_PAGE_SCALE, 1);
9013c9
+	info = ev_document_get_info (EV_PRINT_OPERATION (print)->document);
9013c9
+	if (info->ui_hints & (1 << 30))
9013c9
+		page_scale = EV_SCALE_NONE;
9013c9
+	else
9013c9
+		page_scale = gtk_print_settings_get_int_with_default (settings, EV_PRINT_SETTING_PAGE_SCALE, 1);
9013c9
 	autorotate = gtk_print_settings_has_key (settings, EV_PRINT_SETTING_AUTOROTATE) ?
9013c9
 		gtk_print_settings_get_bool (settings, EV_PRINT_SETTING_AUTOROTATE) :
9013c9
 		TRUE;
9013c9
--- a/shell/ev-window.c
9013c9
+++ b/shell/ev-window.c
9013c9
@@ -3040,10 +3040,23 @@ ev_window_save_print_settings (EvWindow
9013c9
 			       GtkPrintSettings *print_settings)
9013c9
 {
9013c9
 	GKeyFile *key_file;
9013c9
-	gint      i;
9013c9
+	gint      i, page_scale;
9013c9
+	EvDocumentInfo *info;
9013c9
 
9013c9
 	key_file = get_print_settings_file ();
9013c9
+
9013c9
+	/* Do not store page scaling enforced by opened document */
9013c9
+	info = ev_document_get_info (window->priv->document);
9013c9
+	page_scale = gtk_print_settings_get_int (print_settings, "evince-print-setting-page-scale");
9013c9
+	if (info->ui_hints & (1 << 30) && page_scale == 0) {
9013c9
+		page_scale = g_key_file_get_integer (key_file,
9013c9
+						     EV_PRINT_SETTINGS_GROUP,
9013c9
+						     "evince-print-setting-page-scale",
9013c9
+						     NULL);
9013c9
+	}
9013c9
+
9013c9
 	gtk_print_settings_to_key_file (print_settings, key_file, EV_PRINT_SETTINGS_GROUP);
9013c9
+	g_key_file_set_integer (key_file, EV_PRINT_SETTINGS_GROUP, "evince-print-setting-page-scale", page_scale);
9013c9
 
9013c9
 	/* Always Remove n_copies from global settings */
9013c9
 	g_key_file_remove_key (key_file, EV_PRINT_SETTINGS_GROUP, GTK_PRINT_SETTINGS_N_COPIES, NULL);