Opened 4 years ago

Last modified 15 months ago

#6008 in-progress bug

PCL5 printer driver prints with wrong margins, repeated text

Reported by: dru_ed Owned by: jackburton
Priority: normal Milestone: R1
Component: Printing Version: R1/alpha2
Keywords: PCL, PCL5, LaserJet Cc: ithamar
Blocked By: #6070 Blocking:
Has a Patch: no Platform: x86

Description

Printing text documents (see attached StyledEdit example) using PCL5 driver results in incorrect output.

Test was to print the first page of the sample document. "Print setup" had margins of 1 inch on each side. Paper size was Letter. Printed in Portrait mode.

See attached scan of resulting document for details of incorrect output: text was cut off on the left and right margins, in place of the page of text a single paragraph was repeated down the page, margins were incorrect.

Attachments (8)

taleprintout.png (43.6 KB) - added by dru_ed 4 years ago.
scan of actual printed document
Tale.zip (25.0 KB) - added by dru_ed 4 years ago.
StyledEdit test document & PDF output via "print to pdf"
bepdfprint.png (15.0 KB) - added by dru_ed 4 years ago.
Scan of printout BePDF Documentionat pg 17 of 36, "Printing"
printjob.zip (185.6 KB) - added by dru_ed 4 years ago.
print job file, pcl5 driver, bepdf manual page 17
37006printing.png (21.4 KB) - added by dru_ed 4 years ago.
Print sample, BePDF actual page 17 on Haiku 37006 nightly.
Aug1HaikuPrintingWeb.png (62.9 KB) - added by dru_ed 4 years ago.
Print Sample Haiku 37825
Aug1MacPrintingWeb.png (159.9 KB) - added by dru_ed 4 years ago.
Sample PDF printout on Mac OS X for comparison
PrintJob Setup.png (36.9 KB) - added by laplace 4 years ago.
Gamma and Ink Usage in PrintJob Setup Dialog

Download all attachments as: .zip

Change History (41)

Changed 4 years ago by dru_ed

scan of actual printed document

Changed 4 years ago by dru_ed

StyledEdit test document & PDF output via "print to pdf"

comment:1 follow-up: Changed 4 years ago by laplace

It is interesting that even in the PDF version the text to the right gets truncated. I haven't looked at the source code of StyledEdit, but I guess there is something wrong in the printing code.

You could try to print a page of the user guide in BePDF. If it works then StyleEdit must have a bug.

comment:2 Changed 4 years ago by ithamar

Indeed I suspect this is StyledEdit, I have seen similar problems with printing through the Postscript printer driver from StyledEdit.

Changed 4 years ago by dru_ed

Scan of printout BePDF Documentionat pg 17 of 36, "Printing"

comment:3 in reply to: ↑ 1 Changed 4 years ago by dru_ed

Replying to laplace:

You could try to print a page of the user guide in BePDF. If it works then StyleEdit must have a bug.

It's not just StyledEdit. I tried to print page 17 of 36, "Printing," in the BePDF manual and got similar output: A top portion of the document was repeated down the page.

See attached scan of printed output (Filename: bepdfprint.png).

comment:4 Changed 4 years ago by stippi

I can confirm that with the IPP add-on. I was able to print to a printer (Canon IP4200) attached and published via a Mac Mini running OSX. I tried to print a page that had just "Test" once at the top, but Test repeated until the end of the page when it came out of the printer.

comment:5 follow-up: Changed 4 years ago by stippi

Darn, forgot to mention I was using Pe to print.

comment:6 Changed 4 years ago by phoudoin

Does the repeated text is only on last page or each one?
Does it works as expected with Preview and PDF Writer *printers*?

comment:7 in reply to: ↑ 5 ; follow-up: Changed 4 years ago by laplace

Replying to stippi:

Darn, forgot to mention I was using Pe to print.

So the issue is not application specific. Damn! It is always easier to blame someone else :)

If no one beats me, I will investigate this on the weekend.

If someone wants to look into it also in the mean time, my next guesses are that something is broken recording into a BPicture, archiving it or dearchiving from it. My next step would be to check if the contents of a print spool file is correct.

comment:8 in reply to: ↑ 7 ; follow-up: Changed 4 years ago by phoudoin

So the issue is not application specific.

But could be driver specific. Hence my questions...

If someone wants to look into it also in the mean time, my next guesses
are that something is broken recording into a BPicture, archiving it
or dearchiving from it.

Or clipping & raster banding. But the repeated pattern seems to be BPicture bounded indeed. The picture position and rect could be corrupt too.

dru_ed, could you attach the job file or the dump from DumpPrintJob (see src/tests/kits/interface/pictureprint) on the same document?

Changed 4 years ago by dru_ed

print job file, pcl5 driver, bepdf manual page 17

comment:9 in reply to: ↑ 8 Changed 4 years ago by dru_ed

Replying to phoudoin:

dru_ed, could you attach the job file or the dump from DumpPrintJob (see src/tests/kits/interface/pictureprint) on the same document?

I attached the job file. I noticed the "Letter" size page "Width" shows as "8.26 in" in BePDF's "Print Settings." It should be "8.50." "Height" is listed correctly as "11.00 in"

comment:10 Changed 4 years ago by laplace

  • Blocked By 6070 added

Drawing a BPicture ignores the offset currently (see ticket #6070).

comment:11 Changed 4 years ago by laplace

Ticket #6070 is now closed and the repeated bands in the print output should not appear any more.

I don't know if this is a new issue. In "Preview" the clipping is not correct and the more you zoom into the page the fewer output is shown, until nothing can be seen.

Changed 4 years ago by dru_ed

Print sample, BePDF actual page 17 on Haiku 37006 nightly.

comment:12 follow-up: Changed 4 years ago by laplace

Sorry for the late reply and thank you for the new print sample.

It looks like there are still issues drawing a BPicture. I will try to reproduce the problem in the test application mentioned in #6070 so that it can be fixed.

comment:13 in reply to: ↑ 12 ; follow-ups: Changed 4 years ago by jackburton

Replying to laplace:

Sorry for the late reply and thank you for the new print sample.

It looks like there are still issues drawing a BPicture. I will try to reproduce the problem in the test application mentioned in #6070 so that it can be fixed.

If you manage to create a reproducible test I can very well have a look.

comment:14 in reply to: ↑ 13 Changed 4 years ago by laplace

Replying to jackburton:

I will do when time permits.

comment:15 in reply to: ↑ 13 Changed 4 years ago by laplace

Replying to jackburton:

It looks like there are still issues drawing a BPicture. I will try to reproduce the problem in the test application mentioned in #6070 so that it can be fixed.

If you manage to create a reproducible test I can very well have a look.

It turned out, that when the picture is drawn with an offset and the scale factor is not 1, the scaled drawing offset is not taken into account.

See hrev37818 "Test Draw Scaled Picture" in the result you should see a 16x16 filled rectangle at the left top (which is shown) and at the middle top a 8x8 filled rectangle (which is shown at the right top right now).

comment:16 follow-up: Changed 4 years ago by jackburton

I think I can have a look at this, Michael, unless you absolutely want to fix it yourself.

comment:17 in reply to: ↑ 16 Changed 4 years ago by laplace

Replying to jackburton:

I think I can have a look at this, Michael, unless you absolutely want to fix it yourself.

I would prefer not to look into this :) because I would have to study the appropriate source code first.

comment:18 Changed 4 years ago by jackburton

  • Owner changed from laplace to jackburton
  • Status changed from new to in-progress

comment:19 follow-up: Changed 4 years ago by jackburton

The test case is fixed in hrev37824. Please verify if this fixes also the printing problem, and close the ticket in that case.

comment:20 in reply to: ↑ 19 Changed 4 years ago by laplace

Replying to jackburton:

The test case is fixed in hrev37824. Please verify if this fixes also the printing problem, and close the ticket in that case.

I hope tru_ed is still motivated to verify that.

However this change broke rendering of BPictureButton see ticket #6415.

Version 0, edited 4 years ago by laplace (next)

Changed 4 years ago by dru_ed

Print Sample Haiku 37825

Changed 4 years ago by dru_ed

Sample PDF printout on Mac OS X for comparison

comment:21 follow-ups: Changed 4 years ago by dru_ed

I print sample, BePDF Help actual page 17, on 37825. Only half the page prints.

Output is also very pale again. See attachment "Aug1HaikuPrintingWeb.png" for scan of actual printed output.

The printer continues to print the job over and over because the spool does not get deleted after printing.

Also, as in comment 9: "Letter" size page "Width" shows as "8.26 in" in "Print Settings." It should be "8.50." "Height" is listed correctly as "11.00 in"

For comparison purposes I printed the same page on Mac OS X via CUPS; see attachment "Aug1MacPrintingWeb.png."

Changed 4 years ago by laplace

Gamma and Ink Usage in PrintJob Setup Dialog

comment:22 in reply to: ↑ 21 Changed 4 years ago by laplace

Replying to dru_ed:

Thanks for testing!

I print sample, BePDF Help actual page 17, on 37825. Only half the page prints.

Could you try it again with the patch attached to ticket #6415?

Output is also very pale again. See attachment "Aug1HaikuPrintingWeb.png" for scan of actual printed output.

The brightness can be controlled with the Gamma and Ink Usage sliders:
Gamma and Ink Usage in PrintJob Setup Dialog

The printer continues to print the job over and over because the spool does not get deleted after printing:


Also, as in comment 9: "Letter" size page "Width" shows as "8.26 in" in "Print Settings." It should be "8.50." "Height" is listed correctly as "11.00 in"

I will look into these 2 points later.

comment:23 in reply to: ↑ 21 Changed 4 years ago by laplace

Replying to dru_ed:

Also, as in comment 9: "Letter" size page "Width" shows as "8.26 in" in "Print Settings." It should be "8.50." "Height" is listed correctly as "11.00 in"

BePDF shows the size of a page as stored in the PDF file. Its purpose is so that a user can adjust the zoom factor to print the document in different page size than the one it was generated for (for example Letter on A4 or vice versa).

So that size shown there is probably correct unless you know the PDF file was generated with exact Letter size.

comment:24 in reply to: ↑ 21 Changed 4 years ago by laplace

Replying to dru_ed:

The printer continues to print the job over and over because the spool does not get deleted after printing.

This should not happen. If an error occurs during printing the document should not be printing automatically again. I am not certain what exactly causes the problem.

What transport protocol do you use (USB)?

I have printed the "Tale" document using StyledEdit to a file and the print job file gets deleted afterwards.
Does the print job file get deleted when you print to a file instead?

PS: Sorry that I spelled your name wrong.
BTW is there a way to get the real name or email address from a trac account? I always have difficulties to associate a nick name with it.

comment:25 follow-up: Changed 4 years ago by dru_ed

I'm using USB for transport protocol. The spool file is correctly deleted if I printing a file instead.

Regarding "Print Settings" sizes, I tested another document that was created at 8.5 x 11 and it showed correctly so it works as designed, rather than as expected.

Tested device is a laser printer, I'll experiment with "ink" and "gamma" settings.

I haven't had a chance to build Haiku with the patch at ticket #6415 yet.

comment:26 in reply to: ↑ 25 Changed 4 years ago by laplace

Replying to dru_ed:

I haven't had a chance to build Haiku with the patch at ticket #6415 yet.

I have applied the patch in hrev37939. Can you please test again?

comment:27 follow-up: Changed 4 years ago by dru_ed

Hi. I tested hrev37948. A full page prints now from BePDF. The spool file is not deleted and continues to print to the printer until manually removed as before. Manual removal may crash the print server requiring a restart.

Testing further, I see 2-Up, that is 2 pages printed in a reduced size on 1 sheet of paper prints incorrectly. They should be rotated 90 degrees. Currently they print the correct size but the 2nd page prints half off the right side.

4-Up works, although the pages are printed in an odd order for left-to-right reader. Instead of a top row of pages 1 & 2, and bottom row of pages 3 & 4, Haiku prints 1 & 3 on top with 2 & 4 on the bottom row.

I will note, by comparison, Mac OS X offers four options of layout direction with top row: 1, 2 & bottom row: 3, 4, as default.

A gamma of 1.0 and 50% "ink" is suitably dark for the laser.

comment:28 in reply to: ↑ 27 ; follow-up: Changed 4 years ago by laplace

Replying to dru_ed:

Thanks I will look into the remaining problems after my vacation (about August, 20th).

comment:29 Changed 4 years ago by laplace

  • Cc ithamar added

comment:30 follow-up: Changed 4 years ago by laplace

Ithamar if you have time, could you check if the USB transport add-on is the culprit.

comment:31 in reply to: ↑ 28 Changed 4 years ago by laplace

Replying to laplace:

Thanks I will look into the remaining problems after my vacation (about August, 20th).

Sorry for the wrong promises. My printers at home are not Haiku compatible. Right now I am creating a Gutenprint based printer driver for Haiku, so I can print to (only) one of my printers and then should be able to reproduce the USB problem.

comment:32 in reply to: ↑ 30 Changed 4 years ago by laplace

Replying to laplace:

Ithamar if you have time, could you check if the USB transport add-on is the culprit.

Indeed it was the culprit. This particular problem is fixed in hrev38915. The USBPrintRoster thread has to be stopped before unloading the add-on.

comment:33 Changed 15 months ago by jackburton

Can we close this ticket ?

Note: See TracTickets for help on using tickets.