After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 572741 - margins on printed documents are too small
margins on printed documents are too small
Status: RESOLVED FIXED
Product: gedit
Classification: Applications
Component: printing
3.14.x
Other All
: High normal
: ---
Assigned To: Gedit maintainers
Gedit maintainers
Depends on:
Blocks:
 
 
Reported: 2009-02-22 13:34 UTC by Mathieu Amirault
Modified: 2015-06-07 14:42 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
Print-out of the "Thin clients" Wikipedia page (314.85 KB, application/pdf)
2011-08-31 16:24 UTC, Jean-Philippe Fleury
  Details
Printing: fix margins (4.51 KB, patch)
2015-06-06 19:01 UTC, Sébastien Wilmet
committed Details | Review

Description Mathieu Amirault 2009-02-22 13:34:31 UTC
Upstream from launchpad : https://bugs.launchpad.net/ubuntu/+source/gedit/+bug/331077

In gedit 2.24.2 (Ubuntu 8.10), the margins of a printed document does not seems to be configurable. The left margin is very small - about 1 cm.

While such small margins maximizes the printable text on a page, the left margin is too small to punch holes in the sheet using a paper hole punch - holes are punched in the text.

See attached file, a print-out of the "Thin clients" Wikipedia page, copied from a Web browser and pasted in gedit for printing. Having configurable margins could enable the user to avoid such problems.
Comment 1 Jean-Philippe Fleury 2011-08-31 16:24:04 UTC
Created attachment 195321 [details]
Print-out of the "Thin clients" Wikipedia page

Attached file mentioned on the bug description.
Comment 2 Sébastien Wilmet 2015-02-19 17:59:47 UTC
Still a problem with gedit 3.14.
Comment 3 Sébastien Wilmet 2015-06-06 19:01:56 UTC
Created attachment 304710 [details] [review]
Printing: fix margins

GTK+'s default margins are too small. It was not possible to use a hole
punch, and with some printers the text was truncated on the right.

Add gsettings to configure margins, with better defaults (25mm on each
side). The unit chosen is the millimeter, because it's the international
standard.
Comment 4 Sébastien Wilmet 2015-06-06 19:16:05 UTC
It would be nice to backport the bug fix for the 3.16 and 3.14 versions too, but with the above patch there are new translatable strings (so we need to ask for a string freeze exception, if we take that patch).
Comment 5 Paolo Borelli 2015-06-07 14:10:54 UTC
Review of attachment 304710 [details] [review]:

the patch looks ok to me. Out of curiosity, what are gtk's defaults? I wonder if we should have different defaults for lateral margins and top and bottom margins
Comment 6 Paolo Borelli 2015-06-07 14:12:23 UTC
Review of attachment 304710 [details] [review]:

::: gedit/gedit-print-job.c
@@ -559,2 +568,4 @@
 		g_free (left);
 	}
+
+	g_free (print_font_body);

maybe these leak fixes should be a separate patch if you feel like splitting it
Comment 7 Sébastien Wilmet 2015-06-07 14:38:52 UTC
Commit pushed:
https://git.gnome.org/browse/gedit/commit/?id=355cd2dd89e66efa1023310d66936eddfb55d58f

GTK+'s default is 1/4 of inch, i.e. 6.35 mm (i.e. less than 1cm, which is not enough):
https://git.gnome.org/browse/gtk+/tree/gtk/gtkpapersize.c#n918

There was no memory leak fixes, I just moved the g_free() at the end of the function (cosmetic change).
Comment 8 Sébastien Wilmet 2015-06-07 14:41:32 UTC
Microsoft Word uses 1 inch (25.4mm) on each side. So I guess most people are used to have the same margin size on each side. See:

https://en.wikipedia.org/wiki/Margin_%28typography%29#The_Digital_Page