groff
[Top][All Lists]
Advanced

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

Re: [Groff] patch for pdfroff


From: Keith Marshall
Subject: Re: [Groff] patch for pdfroff
Date: Sun, 30 Jul 2006 16:03:00 +0100

On Saturday 17 June 2006 3:07 am, Zvezdan Petkovic wrote:
> One issue I had is that your sed script erased completely valid EPS
> files (created by ImageMagick convert program from JPG and PNG)
> embedded in my presentations.  Thus I decided to make it an empty
> script for --emit-ps option.  If you ever fix it, so that it doesn't
> remove images, but rather blank pages only, it could be used without
> if-else-fi. [...]
>
> I'd fix that sed script myself if I had a faintest idea how to
> reliably distinguish a valid embedded EPS from a blank page.

The problem with this sed script was that it would delete EVERYTHING from 
the `%%Page: n n' marker record for a new page, down to the first line of 
PostScript code following the associated `%%EndPageSetup' marker, if it 
matched the regular expression `0 *Cg *EP' ANYWHERE within that line 
range.  Clearly, this was too greedy a match specification, which could 
remove page headers where they should have been retained, potentially 
even leading to an invalid PostScript output stream.

I've now tightened the requirement, such that this line group, with 
particular emphasis on the line following the `%%EndPageSetup' record, 
is required, IN ITS ENTIRETY, to EXACTLY match the anchored regular 
expression `^%%Page:.*\n0 Cg EP$'.  This should be rather more robust.  
It is in CVS, as of last night, so do please test it.

Note that, because I'm using an extended pattern space to capture all the 
lines from the `%%Page:...' marker down to the `0 Cg EP', I've used the 
`\n' pattern as a start of line anchor for the `0 Cg EP'.  Any POSIX 
conforming sed should work with this, but are there any non-POSIX 
implementations which may not?  If so, do I need to try to support them?

Regards,
Keith.




reply via email to

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