PDFdev is a service provided by PDFzone.com | http://www.pdfzone.com _____________________________________________________________ I produce documents with a typographic formatter that explicitly places words rather than just emitting lines of text with spaces.  The program produces PostScript which is then distilled into PDF.

The visible output is fine.  But screen reader programs for the visually impaired run the strings together, since there are no spaces.

We've come up with a way to emit a zero-width space (ZSP) in the places where spaces would occur.  This lets the formatter do its high-precision placement and also provides spaces to make the screen readers flow text more sensibly.  We've defined a procedure called ZSP in the PS prolog and call it in each place where it seems a space would happen.

However, there are cases, typically at the start of a page, where the formatter is doing movement that "looks" like a space, so we emit a ZSP call, but the formatter hasn't yet defined a current point (because it hasn't had any characters to print, I suppose).  That causes PS errors, so we do a 'moveto' to be sure there is a current point.

This causes some screen readers to break up the line into separate words.

I came up with a test for a current point so we would only do the move if there were none.  This works in the screen readers but the files balloon in size, from 20%-40% in the samples I've seen.  Looking at the files with Space Audit in Acrobat 5.0, nearly all the extra space is in the Content Streams section.

Here is the comparative PS code:

- both versions have this first in the PS prolog:
  /ZSPfont /Helvetica findfont def

- in the original PS prolog, this defines the procedure:
  /ZSP {gsave ZSPfont setfont
   0 0 M
   ( )[0] xshow grestore} bind def

- in the modified PS prolog we replace the '0 0 M' with this:
   {currentpoint pop pop} stopped {0 0 M} if

In both cases, the call to the procedure within the page content is simply:

  ZSP

Obviously, the only difference is in the part containing '0 0 M'.  (And yes, we define 'M' as 'moveto' elsewhere, and use it all over the place.)

Why would the PDF files be so much larger with the modified PS code?  Is there anything we can do about it?  Distiller Mastery is such a dark science.  :-)

Thanks,
MarkD

--
*****  Mark.DeVries.AT.xyenterprise.DOT.com
****  Xyvision Enterprise Solutions 781-756-5303
***  30 New Crossing Road, Reading MA 01867 USA
To change your subscription: http://www.pdfzone.com/discussions/lists-pdfdev.html

Reply via email to