Bug 142557 - Poster command doesn't work; ghostscript's poster expects EPS but kprinter sends it PS
Summary: Poster command doesn't work; ghostscript's poster expects EPS but kprinter se...
Status: CLOSED WORKSFORME
Alias: None
Product: kdeprint
Classification: Unmaintained
Component: general (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: KDEPrint Devel Mailinglist
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-03-05 17:36 UTC by Tristan Miller
Modified: 2008-12-31 20:45 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Sample PostScript file to print (input.ps) (115.80 KB, application/postscript)
2007-03-05 17:37 UTC, Tristan Miller
Details
Sample incorrect kprinter poster output file (output.ps) (228.34 KB, application/postscript)
2007-03-05 17:38 UTC, Tristan Miller
Details
Sample correct poster output file (output2.ps) (228.79 KB, application/postscript)
2007-03-05 17:39 UTC, Tristan Miller
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tristan Miller 2007-03-05 17:36:26 UTC
Version:            (using KDE KDE 3.5.5)
Installed from:    SuSE RPMs

Kprinter allows the user to enlarge a document into a poster printed on multiple pages.  It apparently does this by feeding the raw PostScript document to the ghostscript "poster" command.  However, "poster" expects EPS files, not plain PostScript files.  As a result, many (or most) documents get mangled and don't print properly.

Steps to reproduce:

1. Invoke kprinter somehow (through a KDE application's print command, or through the command line).  For the purposes of this bug report, assume that I have invoked it on the command line to print a file input.ps.
2. Select any printer.  For the purposes of this bug report, assume that I am using "Print to file (PostScript)" and specify the output file output.ps.
3. Properties->Poster
4. Check the "Print poster" box and adjust the other settings to taste.
5. OK
6. Print

Observed behaviour:
bar.ps contains a bunch of nonsense which cannot be viewed or printed properly.  It contains exactly the same data as if the Ghostscript poster command had been run on foo.ps.

Expected behaviour:
poster apparently expects encapsulated PostScript as its input.  (Quoth the man page: "It expects as input a generic (encapsulated) postscript file".)  kprinter should have first converted the data to EPS (via ps2epsi, for example), and then passed this EPS file to poster.  When it's done this way, the output file (say, output2.ps) is a correct multipage poster.
Comment 1 Tristan Miller 2007-03-05 17:37:32 UTC
Created attachment 19887 [details]
Sample PostScript file to print (input.ps)
Comment 2 Tristan Miller 2007-03-05 17:38:33 UTC
Created attachment 19888 [details]
Sample incorrect kprinter poster output file (output.ps)
Comment 3 Tristan Miller 2007-03-05 17:39:15 UTC
Created attachment 19889 [details]
Sample correct poster output file (output2.ps)
Comment 4 Kurt Pfeifle 2007-03-09 15:07:01 UTC
First of all: there is no Ghostscript "poster" command *at all*. The only "poster" utility I know of is an external tool (independent of Ghostscript). This is what KDEPrint uses.

Be aware that KDEPrint requires a patched version of poster (available from http://printing.kde.org/download/) -- however, AFAIK the upstream author of poster has accepted the KDEPrint patches into his sources quite some years ago already; so a newer "standard" poster should be OK.

Your quote of the man page is not correct (because it is incomplete). You cut off the decisive part: "...[a PS file]  normally  printing  on  a single page."

Your attachment 19887 [details] (input) satisfies that requirement... hmmm.... and also, SUSE RPMs should work too (they ship the patched poster utility since quite a long time). [You are wrong in assuming that "poster" *requires* EPS -- it only requires EPS *OR* PostScript that prints on one page. It requires 1-page PS documents that comply to the "DSC" definition (Document Structuring Convenctions). However, it may be it is just "safer" to convert to EPS first...]

I notice that your original/input PS was created by OpenOffice.org. OOo is known for creating *non-DSC-compliant* PS code quite regularly.

How did you create your attachment 19889 [details]? Did you run "poster" on the command line?


I can't test right now, but possibly a regression creeped into KDE's code too. Will try to test later (if I can get access to a SUSE-Linux box later tonight).

Comment 5 Kurt Pfeifle 2007-03-09 16:22:07 UTC
I've thought of a workaround for you, but can't myself test it right now.

The idea is this: use the KDEPrint pre-filtering system to try and create a more DSC-compliant PostScript file before it goes to "poster".

Proceed like this:

 1. Load your input.ps into kprinter: "kprinter input.ps"
 2. Select your output printer "Print to File (PostScript)"
 3. Click "Properties", select "Poster" tab, setup your options
 4. Click on "Filters" tab (the very left one)
 5. You should see "Poster printing" there already now
 6. Add another filter to the chain: click the "funnel" icon
 7. Select "Multiple Pages per Sheet Filter"; confirm with "OK"
 8. Make sure "Multiple Pages" filter is listed 1st, "Poster" 2nd
 9. Select "Multiple Pages", click "Configure Filter" (bottom button)
10. Make sure that "Pages per sheet: '1'" and '0' borders and margins are set
11. Click OK twice, send job off to "Print".

Does this now work as expected?

If so, the "Multiple Pages per Sheet" filter (that in reality only printed 1 page per sheet) succeeded to create a DSC-compliant (or otherwise enhanced) PostScript file from your original input, and the poster utility that consumes this as the next filter in the chain works with it.

If you need that functionality more often, you should create an extra "printer instance" that saves the entire settings as additional printer in the drop down list. Here is how:

 1. hit "[alt]+[f2]", 
 2. type "print:/manager", 
 3. select "Print to File", 
 4. click the "Instances" tab in lower half, 
 5. click "New", baptize it with a name you like, 
 6. click "Settings", 
 7. setup the poster printing as described above, 
 8. confirm with final "OK"s 

...and find from now on the "(named as you liked)" printer instance underneath the respective "Print to File" printer in the print dialog drop-down list.
Comment 6 Tristan Miller 2007-03-09 17:56:18 UTC
In response to Comment #4:

Sorry about the confusion regarding the source of poster.  I assumed it was simply a wrapper around Ghostscript, as many other Ghostscript tools are.

Also, I didn't stop to consider that it might be OpenOffice.org that was at fault.  I had tried this with a couple different applications, including OOo, but perhaps both of them produced noncompliant PostScript.

Finally, yes, attachment 19889 [details] was created by running poster on the command line.
Comment 7 Tristan Miller 2007-03-09 17:59:35 UTC
In response to Comment #5: Yes, adding the Multiple Pages per Sheet filter fixes the problem.  Thanks for the suggestion!
Comment 8 Kurt Pfeifle 2007-03-09 18:46:24 UTC
Hah!, I was now able to test it as well.

However, on the SUSE-10.0 system I have access to, kprinter currently is b0rken (again) -- with the symptoms described here: http://lists.kde.org/?t=116975522400003&r=1&w=2

Hence, I booted a Sidux Live CD (http://distrowatch.com/table.php?distribution=sidux). But, alas!, they (and it seems all of $debian) still ship a 1999 version of the "poster" utility. So I copied SUSE-10.0 version of the poster binary to the Sidux system ("scp kurt@some-remote-suse-10-box:/usr/bin/poster /usr/local/bin/poster") and it immediately worked (who would have thought that copying a random binary from SUSE to Debian would let it work?!?)!

Indeed, only when bolting the "Multipage" filter into the chain before the "Poster" one your example file worked. I ran another test with a KWord file, and that worked directly.

One last question, Tristan (I'm just curious): did you notice that KDE's print dialog (including the Poster tab) includes quite some "WhatsThis" help blurbs? I'm just interested to hear feedback from users, if they do at all notice that support given to them, or if these WhatsThis thingies are more or less useless, because nobody does notice they are there...


Thanks to your bug report; this may now lead to a fix for the base "poster" printing problem on Debian as well (they can't have had any working KDEPrint/poster feature *ever* with that old, unpatched poster package they ship).

I'll close this report now (and may write a different one in the next few weeks asking for someone to implement a more robust poster printing feature into KDE4 (which should automatically and silently convert the input to EPS before it goes to poster).
Comment 9 Tristan Miller 2007-03-09 19:11:39 UTC
If you're talking about the balloon help, then yes, I noticed the icon in the application title bar.  I never needed to use it myself, since I already understand all the buttons and tabs and settings, but I can see how it would be useful for someone who is new to KDE/Unix/computers.
Comment 10 Tristan Miller 2007-03-09 19:32:46 UTC
I've reported the PostScript problem on the OpenOffice.org bugtracker: http://www.openoffice.org/issues/show_bug.cgi?id=75263
Comment 11 Xavier Brochard 2007-03-13 12:31:47 UTC
>Thanks to your bug report; this may now lead
>to a fix for the base "poster" printing problem 
>on Debian as well (they can't have had any working 
>KDEPrint/poster feature *ever* with that old, 
>unpatched poster package they ship).

do you mean that it is a fix to the Debian's bug related to the patched poster?

Comment 12 Olivier Berger 2007-09-04 00:42:01 UTC
FYI Debian's bug #379378 describes this problem
Comment 13 John Layt 2008-12-31 20:45:30 UTC
Closing old Resolved status bug.