diff --git a/gedit/gedit-tab.c b/gedit/gedit-tab.c
index 7b81732..2acf1b8 100644
--- a/gedit/gedit-tab.c
+++ b/gedit/gedit-tab.c
@@ -2262,6 +2262,8 @@ get_print_settings (GeditTab *tab)
 {
 	gpointer data;
 	GeditDocument *doc;
+	GtkPrintSettings *settings;
+	gchar *uri, *dir, *name, *ext;
 
 	doc = gedit_tab_get_document (tab);
 
@@ -2270,12 +2272,35 @@ get_print_settings (GeditTab *tab)
 
 	if (data == NULL)
 	{
-		return _gedit_app_get_default_print_settings (gedit_app_get_default());
+		settings = _gedit_app_get_default_print_settings (gedit_app_get_default());
 	}
 	else
 	{
-		return gtk_print_settings_copy (GTK_PRINT_SETTINGS (data));
+		settings = gtk_print_settings_copy (GTK_PRINT_SETTINGS (data));
+	}
+
+	name = gedit_document_get_short_name_for_display (doc);
+	dir = g_get_user_special_dir (G_USER_DIRECTORY_DOCUMENTS);
+	if (dir == NULL)
+	{
+		dir = g_get_home_dir ();
+	}
+	if (g_strcmp0 (gtk_print_settings_get (settings, GTK_PRINT_SETTINGS_OUTPUT_FILE_FORMAT), "ps") == 0)
+	{
+		ext = "ps";
 	}
+	else
+	{
+		ext = "pdf";
+	}
+	uri = g_strconcat ("file://", dir, "/", name, ".", ext, NULL);
+
+	gtk_print_settings_set (settings, GTK_PRINT_SETTINGS_OUTPUT_URI, uri);
+
+	g_free (uri);
+	g_free (name);
+
+	return settings;
 }
 
 /* FIXME: show the message area only if the operation will be "long" */
