[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Groff] pdfroff broken?

From: Keith MARSHALL
Subject: Re: [Groff] pdfroff broken?
Date: Thu, 16 Mar 2006 15:51:10 +0000

Werner Lemberg wrote, quoting me:
>>>  grops:<standard input>:594: lines in X exec command must not be
>> [...]  This isn't the cause of the overlong \X lines; the actual
>> cause is that the .pdfmark macro emits the entire pdfmark code for
>> each link in a single \X line, and that obscenely long URL exposes a
>> limitation of this design.
> Well, the limitation is hmm, old.  It serves only to enforce a
> document structure which is fully compliant to the DSC.  I doubt that
> there are still many printers which refuse PS files with lines longer
> than 255 characters...
> As a first measure I've replaced the errors in grops with warnings so
> that overlong lines actually get included into the output.

That helps, of course, but I think it would still be worth seeking an
implementation which satisfies the DSC limitation, and will therefore
not be dependent on this grops modification.

>> I guess the solution will be to adapt the .pdfmark implementation,
>> such that it distributes its output over multiple \X lines.
> Hopefully, you get something working.  On the other hand, it no longer
> causes severe problems.

I've got a partial implementation working.  It works with the existing
text of, but it isn't robust in its handling of parentheses,
as delimiters for quoted literals.  It needs a bit more work to make it
completely satisfactory.

There is one small question I'd like to clarify:  is the `ps:exec' tag
included in the count for the 255 character limit?  In other words, in
the following patch fragment, must I leave the `.length' request as it
appears here, or can I safely remove the `ps:exec' from the string I'm
testing to set `pdfmark.length'?

Index: pdfmark.tmac
RCS file: /cvsroot/groff/groff/contrib/pdfmark/pdfmark.tmac,v
retrieving revision 1.5
diff -u -r1.5 pdfmark.tmac
--- pdfmark.tmac        26 May 2005 21:01:57 -0000      1.5
+++ pdfmark.tmac        15 Mar 2006 21:22:47 -0000
@@ -67,7 +67,71 @@
 .\" operator; DO NOT include them in the instruction text!
 .\" ----------------------------------------------------------------
-.if \\n[PDFOPMODE] \X'ps:exec [\\$* pdfmark'\c
+.if \\n[PDFOPMODE] \{\
+.\" Strict DSC compliance forbids emission of ps:exec lines which
+.\" exceed 255 characters in length.  We will push out the entire
+.\" "pdfmark" in one chunk, provided it fits within this limit.
+.   length pdfmark.length "ps:exec [\\$* pdfmark\"
+.   ie (\\n[pdfmark.length] < 255) \X'ps:exec [\\$* pdfmark'\c
+.   el \{\
+.   \"
+.   \" But, when the limit would be violated, then we must
+.   \" recompose the specified "pdfmark", spreading it over as
+.   \" many continuation lines as are necessary.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]