Various applications print outside margins

Bug #1045486 reported by Panayiotis Karabassis
20
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Evince
Expired
Medium
GTK+
Fix Released
Medium
HPLIP
New
Undecided
Unassigned

Bug Description

This has happened when printing large documents with evince (even though I have selected 'shrink to fit') and with firefox, where it happens on all webpage prints. I assume at least the latter to be well-tested so I am reporting it here.

Some portions of the page (top and bottom) simply won't print. For example the header and/or footer firefox inserts on web pages does not print. (see attached scan.) Firefox no longer offers options to adjust margins.

Changing paper size to A4 borderless where possible fixes this. Unfortunately firefox does not print at all in this size, libreoffice refuses to use the duplexer with A4 borderless printing, and evince shows some strange behavior AFTER the print (the duplexer options disappear) even though the print goes on, and without cropping. I am still not sure whether double sided printing is supported for A4 borderless.

Revision history for this message
Panayiotis Karabassis (panayk) wrote :
Revision history for this message
Panayiotis Karabassis (panayk) wrote :

The printer model is HP Photosmart 7510. The driver is hpcups, as opposed to hpijs which unfortunately does not work at all.

Revision history for this message
goutam kodu (goutam-hplip) wrote :

Hi,

Please provide us the "hp-check -t" command output here. We shall take a look into your issue.

You cannot print duplex on A4 borderless paper size. Please select "A4 Auto duplex" paper size for printing duplex.

Thanks,
goutam

Revision history for this message
Panayiotis Karabassis (panayk) wrote :

Thanks!

I am afraid there are no Auto Duplex paper sizes at all.

Revision history for this message
Panayiotis Karabassis (panayk) wrote :

I attach the .ppd as well (auto-generated).

Revision history for this message
goutam kodu (goutam-hplip) wrote :

Thank you for your input.
Please use the attached ppd file and test

Revision history for this message
Panayiotis Karabassis (panayk) wrote :

Thanks.

I am afraid it does not print at all (A4 AutoDuplex). The job gets stuck:

processing since Wed 12 Sep 2012 02:23:44 PM EEST "Rendering completed"

But nothing comes out of the printer.

This has happened before when attempting to print to A4 Marginless with Duplex enabled.

Revision history for this message
Panayiotis Karabassis (panayk) wrote :

Sorry I meant A4 Borderless. :-)

Revision history for this message
Panayiotis Karabassis (panayk) wrote :

Hey some more info: One-sided A4 printing also shows top margin cropping. So it seems Duplex/non-Duplex is unrelated. Sorry I didn't find this out earlier.

Revision history for this message
goutam kodu (goutam-hplip) wrote :

Hi ,

Can you please install the latest hplip-3.12.9 driver downloadable at http://hplipopensource.com/hplip-web/gethplip.html and install it by running command "sh hplip-3.12.9.run".

Kill the "hp-systray" process if running.

Delete the existing printing queues in "system-config-printer"

Setup the printer by running "hp-setup" command in terminal.

If the issue still persists please provide us some logs to analyse this issue.

I believe there could be something wrong in the filters.

To dig more into this problem i would request you to help me by provide some more logs.
Below are the steps to capture the same,

1.Open the file /etc/cups/cupsd.conf in write permissions.
$su -c "gedit /etc/cups/cupsd.conf"
 Change LogLevel warn to LogLevel debug and below that line add hpLogLevel 15.

2. Restart the cups
$su -c " /etc/init.d/cups restart"

3. Empty the message file and error_log file.

$ su -c" cat /dev/null > /var/log/syslog"
$ su -c" cat /dev/null > /var/log/cups/error_log"

4. Print the A4 duplex job.

5. Capture the message and error_log files

$ su -c" cat /var/log/messages > ~/Desktop/messages.txt
$ su -c "cat /var/log/cups/error_log > ~/Desktop/error_log.txt

Attach the files messages.txt and error_log.txt

6. In /var/log/hp/tmp folder you will find files with name starting with hpcups like, hpcupsfilterc_1.bmp, hpcupsfilterk_1. bmp, hpcups_jobX.out.

Can you please attach these files too.

Thanks,
Goutam

Revision history for this message
Panayiotis Karabassis (panayk) wrote :

Yes, 3.12.9 worked.

But:

1) First off, installation was not smooth.

The .run script would not run, saying that CUPSEXT is missing. I had to copy the relevant module from an hplip .deb installation, since this is the only place in Debian where this file is available. Perhaps this is something that should be packaged in the .run script?

Secondly, by default several options were missing. HPCUPS was not installed, so I had to do a custom ./configure to get it. Also foomatic-rip-hplip, is not built/installed by default, but on one of my installs (perhaps after I had cleaned all debian packages) hpijs which is the default driver would not work without it.

2) HPIJS does not work. Even when it did not complain about foomatic-rip-hplip, the printer would either give an error (prnt/hpcups/HPCupsFilter.cpp 536: cupsRasterOpen failed, fd = 0), or the printer would eat through all available paper, printing a couple of garbage characters on each page.

Apart from that, I am not very keen on using HPIJS, since it now contains non-free components.

3) I installed HPCUPS, using the CUPSEXT hack above, and configuring with options:

--enable-doc-build --disable-hpijs-only-build --enable-hpijs-install --enable-new-hpcups --enable-foomatic-ppd-install --enable-foomatic-drv-install --enable-cups-drv-install --enable-cups-ppd-install --enable-foomatic-rip-hplip-install

Before that, I carefully removed every hp-related debian package I could find.

Results: The first printing to double-sided A4 failed, with some error message that I unfortunately did not take a note of.

All subsequent prints to A4 paper size, either double-sided or single-sided worked perfectly (no margin cropping). The margins do appear to be small (close to borderless), but this is a feature right? :-)

4) Printing to A4 AutoDuplex, either in One-Sided or Duplex mode simply does not work. It fails loudly or silently as described in post #7.

Let me know how you would like to proceed? Do you want the debug logs from the failed AutoDuplex prints, or not, since regular A4 works in Duplex mode?

Thanks, I really appreciate your support. It's inspiring to see a company like HP provide this level of effective support for its products on GNU/Linux, when most companies don't even try on any platform.

Revision history for this message
Panayiotis Karabassis (panayk) wrote :

EDIT: possibly the "prnt/hpcups/HPCupsFilter.cpp 536: cupsRasterOpen failed, fd = 0" error was from the failed hpcups prints (Auto-duplex).

Revision history for this message
Panayiotis Karabassis (panayk) wrote :

The 3.12.9 PPD file that works, also works with 3.12.6. There are minimal changes from the one you sent me.

Revision history for this message
Panayiotis Karabassis (panayk) wrote :

I attach the files from the failed AutoDuplex job. Unfortunately this is from Debian's 3.12.6, since I cannot keep a non-packaged hplip on my system. The .ppd is from 3.12.9 though.

Revision history for this message
Panayiotis Karabassis (panayk) wrote :

This is the cups debug log. I think you'll be interested in line 1041.

Finally there are no files under /var/log/hp/tmp, but there exists /tmp/hpcups_job411.out (411 is the failed job). It is empty.

Revision history for this message
goutam kodu (goutam-hplip) wrote :

Thank you for your patience and being with us in providing the log files.

I checked syslog and error_log files and the only doubt that is striking me from where this value is getting PageSize=Custom.Custom.595.28x841.89

To my knowledge in PPD file we add different hardware margins for same PaperSize type. One normal, other is borderless and other AutoDuplex.
For example:

In hpcups.drv file we add these

1. Normal : CustomMedia "A4/A4 210x297mm" 595.44 841.68 9 9 9 9 "<</cupsInteger0 26/PageSize[595.44 841.68]/ImagingBBox null>>setpagedevice"
         "<</cupsInteger0 26/PageSize[595.44 841.68]/ImagingBBox null>>setpagedevice"
2. Borderless: CustomMedia "A4.FB/A4 Borderless 210x297mm" 610.992 855.792 0 0 0 0 "<</cupsInteger0 26/PageSize[610.992 855.792]/ImagingBBox null>>setpagedevice"
         "<</cupsInteger0 26/cupsReal0 .098/cupsReal1 .098/PageSize[610.992 855.792]/ImagingBBox null>>setpagedevice"
3. Auto duplex: CustomMedia "A4.Duplex/A4 AutoDuplex 210x297mm" 595.44 832.68 9 33.192 9 42.192 "<</cupsInteger0 26/PageSize[595.44 832.68]/ImagingBBox null>>setpagedevice"
         "<</cupsInteger0 26/PageSize[595.44 832.68]/ImagingBBox null>>setpagedevice"

Normal PaperSize is used for the normal 1-sided priting
Borderless is used for the non-border printing on 1-side
Autoduplex is used for printing on 2-sided.

Basically above all paper size differ in there hardware margins.

The use case for Duplex print job is
Go to cups url : localhost:631

select printers and click on the print queue and in Administration drop down select "Set default options".
In that select the duplexer as installed and in the General tab select the Paper Size as "A4 AutoDuplex 210x297mm" and click in the "Set Defaults Options" button in the below.

Now Open up the document in a application and perform the same in the print settings and give the print. This should now be able to print the duplex in your printer.

in syslog and error_log you should be able to see PageSize=A4.Duplex

Thanks,
Goutam

Revision history for this message
Panayiotis Karabassis (panayk) wrote :

Thanks!

It seems I am affected by this bug:

https://bugs.launchpad.net/ubuntu/+source/gimp/+bug/998156

So to summarize: A4 margins are fixed in 3.12.9 and the reason I cannot print with some applications is the above bug (e.g. firefox sends a garbage paper size).

One last thing: when I set paper size to A4 AutoDuplex and select "Shrink to printable area" there is still a small(er) portion of the page cropped at the top. Could HPLIP be reporting an incorrect paper size? Or is this yet another bug with GTK/evince?

Out of curiosity, if I am not bothering too much, what are the differences between PageSize, PageRegion, PaperDimension and Imageable area? Does any of them represent the full paper size, i.e. 210x297mm for A4?

Revision history for this message
goutam kodu (goutam-hplip) wrote :

hpcups filter as such does not handle the margins of the paper size. Its the intermediate filter chain in cups (for e.g pstopdf , pdftopdf , pdftoraster , ghostscript ) handles the formating the data to nargin size and "shrink to printable area".

It also depends on what application is sending to the cups filters.

Can you do a thing, Open "system-config-printer" . Select the print queue and left click on it, go to properties. in properties select Job Options and in that check on the "scale to fit" option.

Open a PDF document in Document Viewer and Select the Page Size as A4 Autoduplex and give a duplex job and check if the margins are clipping.

Let us know the same.

Thanks,
Goutam

Revision history for this message
Panayiotis Karabassis (panayk) wrote :

Thanks!

I did as you said: "scale to fit" in system-config-printer.

I then printed three copies with Evince Document Viewer: one with Page Scaling set to "None", one with "Fit to printable area" and one with "Shrink to printable area".

The first copy (None) came off oversized and heavily cropped. The other two copies (Shrink/Fit to printable area) came out fine (no cropping at all).

I am not sure how to interpret this.

There is also an apparently independent option called "Fit to page" under Image Printing in HP Device Manager. Does this only apply to images?

Thank you very much for your continued interest.

Revision history for this message
goutam kodu (goutam-hplip) wrote :

It applies to all not just image.
It is passed as " fitplot " option to cups filters.

Revision history for this message
Panayiotis Karabassis (panayk) wrote :

Thanks, I am familiar with this option from lpr.

And the option under system-config-printer, is it also equivalent to 'fitplot'?

So, does the last test prove anything?

Perhaps evince queries the printer backend about page size, and does its own scaling? Can we learn whether it gets the correct values from cups/hplip?

Revision history for this message
Panayiotis Karabassis (panayk) wrote :

I've opened a bug against evince too: https://bugzilla.gnome.org/show_bug.cgi?id=683984

Changed in evince:
importance: Unknown → Medium
status: Unknown → New
Revision history for this message
Panayiotis Karabassis (panayk) wrote :

We have a certain disagreement at the evince side of the bug, and I think we could use your input.

We have determined, I think, that evince uses only the HWMargins of the PPD file. I proposed a patch to use -instead- the maximum of the HWMargins and the margins induced by ImageableArea.

My understanding is that the area outside the ImageableArea is unprintable, and should therefore be treated as a hardware margin. Is this correct?

Thank you.

Revision history for this message
husfeldt (thomas-husfeldt) wrote :

I still get cut-off margins (running Mint 15) - from Adobe reader, from test-print-page, and from evince... (likely from all programs that is..) - notice that the version of the ppd file (assuming this is the one being used??) is 3.13.3.

- my ppd file "/etc/cups/HP-Photosmart-7510-series.ppd" contains..

*PPD-Adobe: "4.3"
*%%%% PPD file for HP Photosmart 7510 Series with CUPS.
*%%%% Created by the CUPS PPD Compiler CUPS v1.6.2.
*% (c) 2008 Copyright Hewlett-Packard Development Company, LP
*FormatVersion: "4.3"
*FileVersion: "hpcups 3.13.3"
*LanguageVersion: English
*LanguageEncoding: ISOLatin1
*PCFileName: "hp-photosmart_7510_series.ppd"
*Product: "(HP Photosmart 7510 E-all-in-one)"
.......

The relevant sections of the file (I suspect) are paseted below:

*PageSize A4.SM/A4 Small Margins 210x297mm: "<</cupsInteger0 26/PageSize[595.44 841.68]/ImagingBBox null>>setpagedevice"
*PageSize A4.FB/A4 Borderless 210x297mm: "<</cupsInteger0 26/PageSize[610.992 855.792]/ImagingBBox null>>setpagedevice"
*PageSize A4/A4 210x297mm: "<</cupsInteger0 26/PageSize[595.44 832.68]/ImagingBBox null>>setpagedevice"

*PaperDimension A4.SM/A4 Small Margins 210x297mm: "595.440002441406 841.679992675781"
*PaperDimension A4.FB/A4 Borderless 210x297mm: "610.992004394531 855.7919921875"
*PaperDimension A4/A4 210x297mm: "595.440002441406 832.679992675781"

*ImageableArea A4.SM/A4 Small Margins 210x297mm: "9 9 586.440002441406 832.679992675781"
*ImageableArea A4.FB/A4 Borderless 210x297mm: "0 0 610.992004394531 855.7919921875"
*ImageableArea A4/A4 210x297mm: "9 33.192001342773 586.440002441406 790.487976074219"

*PageRegion A4.SM/A4 Small Margins 210x297mm: "<</cupsInteger0 26/PageSize[595.44 841.68]/ImagingBBox null>>setpagedevice"
*PageRegion A4.FB/A4 Borderless 210x297mm: "<</cupsInteger0 26/cupsReal0 .098/cupsReal1 .098/PageSize[610.992 855.792]/ImagingBBox null>>setpagedevice"
*PageRegion A4/A4 210x297mm: "<</cupsInteger0 26/PageSize[595.44 832.68]/ImagingBBox null>>setpagedevice"

Revision history for this message
Roger James (rogerjames99) wrote :

I have add a link to a bug in gtk+. I think the other projects can be removed as the other issues mentioned in this activity log seem to be resolved. The fundamental issue relating to printing from GUI applications that do their own scaling and do not pass on the fit-to-page option to cups still remains unresolved and is a real show stopper. The bug I linked addresses this issue, but seems to be stalled at unconfirmed.

Changed in gtk:
importance: Unknown → Medium
status: Unknown → New
Changed in evince:
status: New → Confirmed
Changed in gtk:
status: New → Confirmed
Changed in gtk:
status: Confirmed → Fix Released
Changed in evince:
status: Confirmed → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.