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 117599 - Implement Printing
Implement Printing
Status: RESOLVED FIXED
Product: gpdf
Classification: Deprecated
Component: general
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: Rémi Cohen-Scali
Rémi Cohen-Scali
: 121142 128151 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2003-07-16 17:04 UTC by Martin Kretzschmar
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
patch with print implementation, based in part on gpdf-outlines branch (7.93 KB, patch)
2003-08-06 23:04 UTC, Martin Kretzschmar
none Details | Review
HIGgified progress dialog glade file (3.48 KB, application/x-glade)
2003-08-06 23:06 UTC, Martin Kretzschmar
  Details
print_dialog destroy statement disabled (8.35 KB, patch)
2003-08-07 01:00 UTC, Rémi Cohen-Scali
none Details | Review
screenshot demonstrating spacing with and w/o trailing space (28.16 KB, image/png)
2003-08-07 19:30 UTC, Martin Kretzschmar
  Details
Updated patch: fixes a leak, splits "_Pages ", this should really work with HEAD (10.90 KB, patch)
2003-08-08 13:22 UTC, Martin Kretzschmar
none Details | Review
Including the fix from Remi's last comment, this time tested against fresh checkout (11.05 KB, patch)
2003-08-09 09:44 UTC, Martin Kretzschmar
none Details | Review
New patch, including progress dialog. Not multi-threaded because I don't want to add threaded code now. (23.33 KB, patch)
2003-08-10 21:33 UTC, Martin Kretzschmar
none Details | Review
Updated Patch. For today's CVS. Without Zoom breakage (19.81 KB, patch)
2003-08-12 19:27 UTC, Martin Kretzschmar
none Details | Review

Description Martin Kretzschmar 2003-07-16 17:04:35 UTC
Implement a print command.

I'm not sure whether to use the GPOutputDev (with its suboptimal font
support) or PSOutputDev.
Comment 1 Michael Lee Yohe 2003-07-23 17:53:24 UTC
I have filed Bug 99339 in the Red Hat Bugzilla database -
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=99339 - for
inclusion of GPdf as the Gnome 2 application for viewing and printing
PDF files.  The only feature necessary for inclusion in the
distribution is the printing feature.

Any estimate on how long it may take for GPdf to get this ability
(even if it has to piggy-back XPdf 2's built-in printing capability)?
Comment 2 Rémi Cohen-Scali 2003-08-03 08:08:33 UTC
Hy

Printing is implemented in gpdf-outlines branch. It should be easily
backported to HEAD for quick availibility.
What is missing at now:
  - Custom range widget (planned)
  - Print status feedback dialog with page thumbnails (planned)
  - Print preview  -- ?but does this really make sense? :-) (planned)

P.S.: While I was studying gpdf rendering architecture, printing seems
so obvious I had to try it to validate my understanding.
Comment 3 Martin Kretzschmar 2003-08-03 11:05:13 UTC
`Sometimes we're afraid because there might be a monster in the room,
and sometimes we're afraid because there is a monster in the room.
When it's just "might be", the thing to do is get information. In the
bedroom, when there might be a monster, we turn on the lights. In
programming, we do an experiment.'

Thanks, Remi. Why can't I just `try to validate my understanding' like
you do ;-)

I haven't tried it yet. You are using gnome-print with correct private
headers (>= 2.2.1.4), aren't you? Did you test with files using
embedded Type 1 and Type 1C (don't know if you have some of these)
fonts. Does it work? Thanks.
Comment 4 Rémi Cohen-Scali 2003-08-03 11:50:29 UTC
Yes, I'am using the 2.3.1 versions of lib GP & GPui, with the font
download patch from bugzilla. It fixes the font looking problem, but
not the integral sign. I think this is normal because the font
download feature is not used in gpdf. Badly I didn't patch gpdf for
using it, so I couldn't verify. I had a look at it but perhaps it is
not as straight forward as it could seems.
If you have a patch (for GPOutputDev) around, let me know ...
Comment 5 John McCutchan 2003-08-04 20:23:01 UTC
This needs to go on before gnome 2.4 ships in september. 
For the real desktop user this is a big regression. in 2.2 you
could print pdfs and in 2.4 you can't (because ggv has dropped pdf
support). Please consider getting special permission for late changes
Maybe just merge the whole pdf-outlines tree.
Comment 6 Rémi Cohen-Scali 2003-08-04 22:25:15 UTC
I think it should. I still have a few things to do before reaching
minimum stability & quality, but it might be good for mid august. 
All features I want to add will be there.
After that it will be time for review ! and fixes ;-)
Comment 7 Murray Cumming 2003-08-06 07:37:29 UTC
This is a new feature, well after the feature freeze. Please see
http://developer.gnome.org/dotplan/tasks.html#ApprovingFreezeBreaks
Comment 8 Rémi Cohen-Scali 2003-08-06 08:42:59 UTC
Ok. I do it.
Comment 9 Martin Kretzschmar 2003-08-06 23:02:45 UTC
Attaching a patch against HEAD implementing (synchronous) printing.

I tried a port from the branch to head. It did print but was
unacceptably slow with large documents (e.g. PDF spec, 1100 pages).
Was it fast for you Remi? I know that it's my code in GPOutputDev and
maybe the gnome-print code that is so slow, not your implementation.

This patch uses the print class from Xpdf and generates PostScript
directly. This PostScript gets fed into gnome-print. It should be as
fast as Xpdf's printing.

The patch doesn't implement asynchronous printing with a progress
dialog yet. Have to do it tomorrow.

Attaching also the HIGgified version of the progress dialog glade file
from the branch.

Remi, can you review my patch?
Comment 10 Martin Kretzschmar 2003-08-06 23:04:38 UTC
Created attachment 18978 [details] [review]
patch with print implementation, based in part on gpdf-outlines branch
Comment 11 Martin Kretzschmar 2003-08-06 23:06:54 UTC
Created attachment 18979 [details]
HIGgified progress dialog glade file
Comment 12 Rémi Cohen-Scali 2003-08-06 23:36:40 UTC
Yes badly it's slow. This is why I threaded the code and thought
cancel button was usefull.
Using PSOutputDev is fine for now, as a workaround for Gnome 2.4, but
we'll have to fix performance problems, either us in gpdf -- if we
have some :-) --, or GP hackers in GP, for Gnome 2.6 or further releases.
The code is very new and this is acceptable (from the developer point
of view).
I'll have a look at the patch ASAP ...
Comment 13 Rémi Cohen-Scali 2003-08-07 00:58:37 UTC
My feedback about the patch. 
First, I test it by applying to HEAD.
I ignored Makefile.am changes needed and focused on patch.
I also ignored UI xml file changes (assumed they will be in final patch)
The lone problem I saw is about gnome-print-dialog. When testing in
outlines branch I noted that gtk_widget_destroy(print_dialog) crashed
when printing several times (two or three times). Have you the same
crash ?
I didn't test (and debug) further because I attribute that behavior to
a  temporary problem (& I'll have time to fix later). 
nevertheless I prefer leak than crash.
Attach patch with that statement disabled.
Comment 14 Rémi Cohen-Scali 2003-08-07 01:00:38 UTC
Created attachment 18983 [details] [review]
print_dialog destroy statement disabled
Comment 15 Christian Rose 2003-08-07 19:19:08 UTC
+	gnome_print_dialog_construct_range_page (
+		GNOME_PRINT_DIALOG (dialog),
+		/* (GNOME_PRINT_RANGE_CURRENT | would be the default -> very bad */
+		(GNOME_PRINT_RANGE_ALL | GNOME_PRINT_RANGE_RANGE),
+		1, control->priv->pdf_doc->getNumPages (),
+		NULL, (const guchar *)_("_Pages "));

What's the last space in "_Pages " for?
Comment 16 Martin Kretzschmar 2003-08-07 19:30:26 UTC
Created attachment 19006 [details]
screenshot demonstrating spacing with and w/o trailing space
Comment 17 Martin Kretzschmar 2003-08-07 19:34:03 UTC
the label to the right of the label "Pages" will be placed too close
without the trailing space.

You might call this a hack around a gnome print ui problem.
Comment 18 Christian Rose 2003-08-07 21:55:04 UTC
I see, but surely there must be a more elegant way to solve that,
without requiring all translations to be updated when the problem is
solved. I'm still at unease with that.
Comment 19 Martin Kretzschmar 2003-08-07 22:06:03 UTC
Yes, the translatable string can be shortened to _Pages. The code has
to append the space then. When the real problem is solved, only the
code has to change.
Comment 20 Christian Rose 2003-08-07 22:20:56 UTC
Sounds good.
Comment 21 Martin Kretzschmar 2003-08-08 13:22:06 UTC
Created attachment 19034 [details] [review]
Updated patch: fixes a leak, splits "_Pages ", this should really work with HEAD
Comment 22 Jonathan Blandford 2003-08-08 21:17:54 UTC
I tried that patch (10934) with HEAD, and got a 

/opt/gnome24/src/gpdf/xpdf/PDFDoc.h:55: undefined reference to
`PSOutputDev::PSOutputDev[in-charge](char*, XRef*, Catalog*, int, int,
PSOutMode)'
Comment 23 Rémi Cohen-Scali 2003-08-09 01:43:17 UTC
Move PSOutputDev sources from gnome_pdf_viewer_SOURCES to 
libgpdf_a_SOURCES in Makefile.am. It should fix the link problem.
Comment 24 Martin Kretzschmar 2003-08-09 09:44:45 UTC
Created attachment 19056 [details] [review]
Including the fix from Remi's last comment, this time tested against fresh checkout
Comment 25 Martin Kretzschmar 2003-08-10 21:33:45 UTC
Created attachment 19088 [details] [review]
New patch, including progress dialog. Not multi-threaded because I don't want to add threaded code now.
Comment 26 Martin Kretzschmar 2003-08-12 19:27:09 UTC
Created attachment 19155 [details] [review]
Updated Patch. For today's CVS. Without Zoom breakage
Comment 27 Martin Kretzschmar 2003-09-01 17:42:56 UTC
*** Bug 121142 has been marked as a duplicate of this bug. ***
Comment 28 Martin Kretzschmar 2003-12-08 14:16:03 UTC
*** Bug 128151 has been marked as a duplicate of this bug. ***
Comment 29 Vincent Untz 2004-02-05 14:17:28 UTC
Shouldn't this bug be closed? Printing is now in, AFAIK.
Comment 30 Martin Kretzschmar 2004-02-06 14:08:14 UTC
Hmm, can't remember if there was a reason to leave it open.