We have a request from a customer to improve the quality of Ghostscript output for faxing. When the attached PDF file is converted to tiffg4 @ 200 dpi the small, colored text is not legible. I suggested using a custom transfer function: << /Install { { 0.85 gt { 1 } { 0 } ifelse } settransfer } >> setpagedevice This greatly improved the text quality but made the graphics and images in the document unusable. The customer would like a way of improving the text darkness but leaving the images alone.
Created attachment 4807 [details] combined.pdf
If this is only required for PDF, perhaps another possibility would be to set the current colour to black when a BT operation is encountered, and reset it on ET ? Its also possible to redefine all the show operators for PostScript to do the same, but tedious...
For general PS input, there are 8 text drawing operators that could be redefined in order to save the currrenttransfer, execute the real operator, then restore the transfer function. In PDF interpreter, it is easier because the BT and ET PDF operators can be hooked to do this. Please let us know if you need a patch for the PDF interpreter, or for PS input documents as well.
The customer reports that they only need PDF input.
This is an alternate 'pdf_ops.ps' that allows applying a unique transfer function defined as /TR_text to PDF text objects. Note that since this only works within BT ... ET PDF text blocks, text that is part of an image will not be affected. Uasge: you must pre-define the transfer function to be applied to text by defining it in userdict. This can be done in a prefix file or by a -c "..." -f sequence on the command line. Example: gswin32c -c "/TR_text { 0.85 gt { 1 } { 0 } ifelse } bind def" -f combined.pdf The changes to pdf_ops.ps are: ------------------------------------------------------------------------------- *** Resource/Init/pdf_ops.ps Wed Dec 10 12:22:06 2008 --- ./pdf_ops.ps Tue Mar 10 10:35:10 2009 *************** *** 450,455 **** --- 450,459 ---- } bdef /BT { + % PATCH TO APPLY A TRANSFER FUNCTION TO TEXT + userdict /TRsave currenttransfer put + userdict /TR_text known { userdict /TR_text get settransfer } if + % END PATCH currentdict /TextLineMatrix .knownget { identmatrix pop TextMatrix identmatrix pop } { matrix /TextLineMatrix gput matrix /TextMatrix gput } *************** *** 461,466 **** --- 465,473 ---- matrix /TextTempMatrix gput % see settextposition } bdef /ET { + % PATCH TO RESTORE the NON-TEXT TRANSFER FUNCTION + userdict /TRsave get settransfer + % END PATCH TextRenderingMode 4 ge { clip newpath } if TextSaveMatrix setmatrix currentdict /TextSaveMatrix undef -------------------------------------------------------------------------------
Customer replies that this works for them and "The graphics and text both look great." Closing.