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 592582 - Print preview doesn't reflect the printout
Print preview doesn't reflect the printout
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Printing
2.17.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
: 347569 594026 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2009-08-21 13:51 UTC by Marek Kašík
Modified: 2009-10-26 16:52 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
a patch generating correct print preview (8.61 KB, patch)
2009-08-21 13:51 UTC, Marek Kašík
none Details | Review
modified patch generating correct print preview (10.65 KB, patch)
2009-09-22 13:16 UTC, Marek Kašík
none Details | Review
modified patch showing correct print preview (10.15 KB, patch)
2009-10-16 14:40 UTC, Marek Kašík
none Details | Review

Description Marek Kašík 2009-08-21 13:51:32 UTC
Created attachment 141330 [details] [review]
a patch generating correct print preview

Print preview shows input document without applying settings from 'General' or
'Page Setup' tab.

Steps to reproduce:
1. run gtk-demo -> Printing
2. change Pages, Copies, Collate, Reverse, Pages per Side, Page Ordering or
Scale
3. press Print Preview

Actual results:
the document without any change

Expected result:
something similar to the printout

patch is attached

Marek
Comment 1 Marek Kašík 2009-08-21 13:53:55 UTC
*** Bug 347569 has been marked as a duplicate of this bug. ***
Comment 2 Marek Kašík 2009-09-08 11:38:13 UTC
*** Bug 594026 has been marked as a duplicate of this bug. ***
Comment 3 Matthias Clasen 2009-09-08 23:59:31 UTC
The one question I have here is what happens if you then go to print that preview from evince ? 

Will that turn a 4-up document into a 16-up one ? Since we are already passing the print settings to evince...
Comment 4 Marek Kašík 2009-09-11 09:52:00 UTC
Hi Matthias,

yes, you are right it print the preview as 16-up. I'll look at it.

Marek
Comment 5 Marek Kašík 2009-09-22 13:16:13 UTC
Created attachment 143695 [details] [review]
modified patch generating correct print preview

This patch changes print settings sent to the preview so that they won't be applied again.

Marek
Comment 6 Matthias Clasen 2009-09-30 16:32:55 UTC
Can you explain that unify_values business to me ? That looks a bit fishy to me, and I am not confident that it will really work. Looking at an example settings .ini file, I see

cups-Duplex=None
duplex=simplex

so, some translation will be necessary for both the key names (case differences) and the values.
Comment 7 Marek Kašík 2009-10-16 14:40:50 UTC
Created attachment 145612 [details] [review]
modified patch showing correct print preview

Hi Matthias,

the function "unify_values" was about setting same values for cups-* settings as for standard setting. If a cups-* setting is present in a key file it is used for print even if there is the same setting without "cups-" (it has higher priority).
I decided to remove such settings (cups-reverse, cups-page-set, cups-scale, cups-number-up and cups-number-up-layout) by gtk_print_settings_unset() to avoid problems with translation of values and keys.

Regards

Marek
Comment 8 Matthias Clasen 2009-10-20 12:25:03 UTC
The removal of cups- keys looks like a reasonable approach. Might be good to add a comment there, explaining why it is done.

I'm stil not 100% convinced that this is the right approach (I would seem more natural to me if evince in its preview mode would interpret these print settings itself). But I am ok with taking this patch now.
Comment 9 Marek Kašík 2009-10-26 16:52:52 UTC
Committed:

    Show correct print preview
    
    Modify print preview according to settings from print dialog.
    Similar approach as during real print is applied to the preview
    process (#592582).

Marek