Created attachment 53460 [details]
pdf created by selecting print to file with the printer language set to pdf
Printing complex documents to a samsung CLP-620ND using libreoffice's default printer language of pdf results in a line of garbage being printed to as many pages as I have in the printer most of the time (some times it works no matter how complicated the document).
Printing simple documents works most of the time.
Changing the printer language to Postscript fixes the problem (as far as I can tell).
Setting the printer language to pdf and selecting print to file creates a pdf that will print from evince, albeit not 100% correctly e.g it won't be positioned properly on the page.
The documents that cause problems tend to be ones that have multiple pages per side, duplexing, colour, or are a different size to the size paper they are being printed on. As sometimes one page will print whilst another almost identical page won't, it is difficult to say exactly what causes the problem.
I have attached a pdf created by selecting print to file with the printer language set to pdf. It has two pages (slightly smaller than A5) printed on one A4 page. If the same options are used in libreOffice but print to file is not checked, it results in garbage being printed. If the pdf is printed from evince it will print, but it will be misaligned (the print preview looks fine).
I spoke too soon about the benefits of changing the printer language to ps. This change still sometimes creates garbage. Currently "printing to file" and then printing the ps file with evince works perfectly with every file I've tried. I don't understand why this would work and not printing straight from libreoffice, but there you go.
I have investigated this problem further and the culprit seems to be the line "%%Page: 1 1" in the ps file. Changing this to "%%Page: 1 0" enables the file to print. I assume that "%%Page: 1 1" is wrong, but I don't know enough about postscript. I have attached a file created with libreOffice which shows this problem. I have also attached the same file created by "print to file" and then printed from evince which prints correctly. Diff shows the following differences:
diff succededPrintout-fromEvince failedPrintout
< %%CreationDate: (Tue Nov 22 17:30:22 2011)
> %%CreationDate: (Tue Nov 22 17:24:43 2011)
< %%Page: 1 0
> %%Page: 1 1
< %%Pages: 1
> %%Pages: 1
Created attachment 53818 [details]
The postscript of a file created by libreOffice taken from the print spool (that casue printer to print garbage)
Created attachment 53819 [details]
The same file created by using libreOffice "print to file" and then printed from evince (which printed correctly)
Arghh. This doesn't seem to be the problem after all :(
The problem seems to be usb related rather than anything to with libreoffice (as the problem goes away if I use the network interface), so I'm closing this bug.