AmiGS cannot Print, because of missing "letter/A4" feature!

A forum for general AmigaOS 4.x support questions that are not platform-specific
User avatar
nbache
Beta Tester
Beta Tester
Posts: 1744
Joined: Mon Dec 20, 2010 7:25 pm
Location: Copenhagen, Denmark
Contact:

Re: AmiGS cannot Print, because of missing "letter/A4" featu

Post by nbache »

Further up in this thread, I asked:
nbache wrote:Do you have the file postscript_init.ps in DEVS:? Is it readable and undamaged?
The reason I did that is that this file starts with the following lines:

Code: Select all

%!PS
% The line above will be replaced by PostScript 52.2+ with something like:
%---------
% %!PS-Adobe-3.0
% %%DocumentMedia: paperformatname paperwidth paperheight 0 () ()
% %%EndComments
%---------

%% $VER: postscript_init.ps 52.2 (15.3.2007)
%%BeginProlog
So I was wondering, does the Postscript which arrives at the printer, contain this DocumentMedia specification or not? If not, and the postscript_init.ps file is there, it looks like a flaw in the PostScript driver, as it should (according to the comment in the file) be responsible for creating it. My guess is that it will do so based on the settings in Prefs/PostScript, so you might also double-check that these are set to A4.

Best regards,

Niels
User avatar
gerograph
Posts: 95
Joined: Sun Mar 25, 2012 10:24 am
Location: Moers
Contact:

Re: AmiGS cannot Print, because of missing "letter/A4" featu

Post by gerograph »

@nbache
I'll recheck, and have a look what happens in the resulting PS files, if I change something inside postscript_init.ps. Of course I will keep a backup of postscript_init.ps.

EDIT:
O.k. I checked, and yes it helps...: This is the situation:

1)
Printing any file (letter/a4/...) works without a problem, when printing from AmiGS ord AmiPDF via "Workbench-Driver". The postscript_init.ps file will be inserted into the "output stream" and the resulting printout or PS file will be A4 (as defined in postscript_init.ps). But
  • Printout takes 5 times as long as directly via postscriptdriver
  • quality is bad. Seems black will be mixed from Cyan/Magenta/Yellow rather than using pure black toner
2)
Printing a letter file from AmiGS or AmiPDF via "Postscript-Driver(PS)", does not work. When changing the Postscriptfile with an Editor and Inerting a "%%DocumentMedia: Custom 595 842 0 ( ) ( )" it prints in excellent quality and very fast.

Thanks nbache, this helped me to understand, why a "Workbench-Driver" is necessary sometimes, plus what "postscript_init.ps" is for !

Conclusion
Seems that not every program/PS Print2file driver can produce A4 sized Media (MS Office/WinXP cannot - FinalWriter can! Thanks to xenic). Also pdf files might come in "letter" size, which aren't printable directly via Postscriptdriver of AmiGS or AmiPDF. Wouldn't it be solution to ask User for an output format, and then add a " %%documentmedia... line " into the outputstream. This would enable users to print "letter" sized PDFs fast and easy on A4 Postscriptprinters via fast and good Postscriptdrivers ??
User avatar
nbache
Beta Tester
Beta Tester
Posts: 1744
Joined: Mon Dec 20, 2010 7:25 pm
Location: Copenhagen, Denmark
Contact:

Re: AmiGS cannot Print, because of missing "letter/A4" featu

Post by nbache »

gerograph wrote:Printing any file (letter/a4/...) works without a problem, when printing from AmiGS ord AmiPDF via "Workbench-Driver". The postscript_init.ps file will be inserted into the "output stream" and the resulting printout or PS file will be A4 (as defined in postscript_init.ps). But
  • Printout takes 5 times as long as directly via postscriptdriver
  • quality is bad. Seems black will be mixed from Cyan/Magenta/Yellow rather than using pure black toner
I don't know much more about the workings of Postscript printing than what I already contributed, but I am wondering whether this slowdown and lower quality could be caused by GhostScript somehow getting involved? Maybe you are able to check whether the gs command is being run at some point during the printing (using Snoopy or Ranger, perhaps). If it is, I imagine it could explain the results. GhostScript is basically a generic and somewhat limited (in terms of resolution and color depth, amonng other things) way to translate PostScript into the language of an arbitrary printer (on Amiga this will probably often be the Workbench printer). If this printer is a PostScript printer itself, we will have gone the long way from PostScript via GhostScript back to PostScript again.

If that is the case, the next question is how to avoid calling GhostScript and still be able to include the init file and thus get the correct media size to the printer.

That is, if I have understood anything about the whole thing at least partly correctly ;-).

Best regards,

Niels
User avatar
gerograph
Posts: 95
Joined: Sun Mar 25, 2012 10:24 am
Location: Moers
Contact:

Re: AmiGS cannot Print, because of missing "letter/A4" featu

Post by gerograph »

@nbache
but I am wondering whether this slowdown and lower quality could be caused by GhostScript somehow getting involved?
I checked, and indeed, GS is involved, when printing via WB Driver -> explains a lot
If that is the case, the next question is how to avoid calling GhostScript and still be able to include the init file and thus get the correct media size to the printer.
As it is the case, yes the question is: how to include an "A4 initfile" when printing directly from GS+AmiGS+AmiPDF to a PS Printer ? Especially from AmiPDF it would be important, in order to be able to print "letter" format on A4.
whose
Posts: 92
Joined: Sun Sep 04, 2011 4:11 pm

Re: AmiGS cannot Print, because of missing "letter/A4" featu

Post by whose »

@gerograph:

Maybe a dumb question, as I didnt read the entire thread, but:

Did you try to give a "-sPAPERSIZE=a4" to the "GS arguments" string gadget (you will find it in the print requester)?

I tried it here and I got a printout of a letter size PDF (did a quick search for "pdf letter example" and got some text example. Its shown as "Letter" in AmiGS) on A4 paper. I used a HP LaserJet 4M/Plus and the "PostScript" driver of AmiGS/GS, not "Workbench driver".

GS resp. the printer driver isnt very clever regarding the printers standard paper sizes, so we are forced to demand it explicitely. Beware: Depending on the output device you may need to issue the "-dFIXEDMEDIA" argument, too.

Additionally, it seems that all GS viewers (resp. their derivates) are even less clever when printing using the system drivers. The extreme delay when using the Workbench driver might result from a rather dumb conversion PS/PDF -> raster gfx -> printer friendly raster gfx (means: PS raster gfx here! Quite time consuming...) -> printout

Btw., Wordworth7 PS output is ok, too. It gives A4 papersize to the printer, if the document to print is A4 in size. I printed Insane-Software invoice with WW7 on my trusty old HP LJ4M/Plus. Well, in fact it doesnt give ANY paper size, so if the output device is conforming to PS standards, it should use its standard paper size for printout. Thats what GS is doing. Its the softwares job to find out the available paper size of the output device and layout the document accordingly.

Its the standard paper size of GS which is the troublemaker here ;-)

I converted the invoice output to PDF using the "-sPAPERSIZE=a4 -dFIXEDMEDIA" arguments for GS. Works ok, but is quite ugly to use...
xenic
Posts: 1185
Joined: Sun Jun 19, 2011 1:06 am

Re: AmiGS cannot Print, because of missing "letter/A4" featu

Post by xenic »

@gerograph
Unless I'm misunderstanding Postscript documentation, "%%DocumentMedia: Custom 595 842 0 ( ) ( )" is a Postscript comment which shouldn't be read by the interpreter. If it is a comment, it doesn't make sense that AmiGS or the Postscript printer would be relying on a comment to get papersize. Are you sure there isn't a Postscript command that also occurs in documents containing "%%DocumentMedia: Custom 595 842 0 ( ) ( )" ??
AmigaOne X1000 with 2GB memory - OS4.1 FE
User avatar
gerograph
Posts: 95
Joined: Sun Mar 25, 2012 10:24 am
Location: Moers
Contact:

Re: AmiGS cannot Print, because of missing "letter/A4" featu

Post by gerograph »

@whose
I converted the invoice output to PDF using the "-sPAPERSIZE=a4 -dFIXEDMEDIA" arguments for GS. Works ok, but is quite ugly to use...
I tried with -sPapersize... , I'll test -dFIXEDMEDIA on top of that.

@xenic
Unless I'm misunderstanding Postscript documentation, "%%DocumentMedia: Custom 595 842 0 ( ) ( )" is a Postscript comment which shouldn't be read by the interpreter. If it is a comment, it doesn't make sense that AmiGS or the Postscript printer would be relying on a comment to get papersize. Are you sure there isn't a Postscript command that also occurs in documents containing "%%DocumentMedia: Custom 595 842 0 ( ) ( )" ??
O.k. you are partly right. Seems there are "%" comments and "%%" comments. As you can see in the PS snippet file below, there is

Code: Select all

/u_pageht 841.90 def
/u_pagewd 595.30 def


which can be found in every A4 postscriptfile I generated from FW, PGS, Word... but it doesn't print. Once you add the line

Code: Select all

%%DocumentMedia: Custom 595 842 0 ( ) ( )
into the "comment section" (see file snippet below) it works... Only if the above mentioned line is apperrant AmiGS will state "A4", as well as my Printer starts printing without askin for a "letter sized sheet".

Code: Select all

%!PS-Adobe-2.0
%%Copyright:     1993-SoftWood, Inc.
%%Creator:       Final Writer
%%CreationDate:  Montag,�M�rz�25.�2013 - 5:05�PM
%%Title:         
%%Pages:         (atend)
%%DocumentFonts:  Helvetica
%%DocumentMedia: Custom 595 842 0 ( ) ( )
%%EndComments
/#copies 1 def
/u_doc () def
/u_time (5:05\240PM) def
/u_date (Montag,\240M\344rz\24025.\2402013) def
/u_pageht 841.90 def
/u_pagewd 595.30 def
% initialize a few blank procedures ( to be replaced in user-def.ps )
/UserDoc {} bind def
/UserEOD {} bind def
/UserBOP {} bind def
/UserEOP {} bind def
% FILE INSERTED: user-def.ps
% ==========================
% ==========================
% END OF FILE: user-def.ps
                                 
User avatar
gerograph
Posts: 95
Joined: Sun Mar 25, 2012 10:24 am
Location: Moers
Contact:

Re: AmiGS cannot Print, because of missing "letter/A4" featu

Post by gerograph »

@whose

entered

Code: Select all

-sPAPERSIZE=a4 -dFIXEDMEDIA
in GS-Arguments String Gadget inside AmiPDF, and voila, was able to print out a Letter sized Documente on my A4 Postscript printer Great !.

So, it boils down to an option force pagesize to printer's page size = -sPAPERSIZE=a4 -dFIXEDMEDIA
whose
Posts: 92
Joined: Sun Sep 04, 2011 4:11 pm

Re: AmiGS cannot Print, because of missing "letter/A4" featu

Post by whose »

@gerograph:

Im glad that I could help with this :-)

PostScript is a nice thing, but GS is a bit too "canonical" to deal with it in a really user friendly way. I would prefer GS having some "locale", so that a GS user could use the locale standard paper size easily. Im missing some config option for this, missing it in "tenthousand" (it feels like) config options ;-)

Or, even better, GS should have printer drivers that are able to determine the standard paper size of the printer connected. Would give much less hassle with things like you experienced.

Well, at least there are those command line arguments that help ;-)
Post Reply