[OS X TeX] Distiller
Jonathan Kew
jonathan_kew at sil.org
Sun Jan 29 16:34:24 CET 2006
On 29 Jan 2006, at 2:14 pm, Siep Kroonenberg wrote:
> On Sun, Jan 29, 2006 at 02:05:22PM +0000, Jonathan Kew wrote:
>> On 29 Jan 2006, at 1:24 pm, Siep Kroonenberg wrote:
>>>
>>> ========= (Non-techies: close your eyes) ===============
>>>
>>> As to the mess of line endings:
>>>
>>> I read the entire eps file in one go, and split the string according
>>> to /\r?\n|\n/ and parse all resulting strings.
>>
>> This is not robust, because EPS files can contain binary sections.
>> (These will be marked by DSC comments such as %%BeginBinary:... I
>> forget the precise syntax offhand.)
>>
>> JK
>
> I believe it is robust for valid eps files, since the boundingbox
> comments should occur in the header or in the trailer. For a valid
> eps file, these will be the only parts that will get scanned.
OK, that sounds more hopeful... your original phrase "parse all
resulting strings" sounded rather global in its scope.
If you're splitting the entire EPS file on /\r?\n|\n/ into an array
of lines (even if you only examine the lines from the header and
trailer), you'll need to take care to restore the exact original line
separator in each place when outputting the file. Some of the line-
breaks found might actually be part of binary data in the body of the
file. In that case, allowing the tool to "regularize" them all to \n,
for example, will be destructive.
JK
------------------------- Info --------------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
& FAQ: http://latex.yauh.de/faq/
TeX FAQ: http://www.tex.ac.uk/faq
List Archive: http://tug.org/pipermail/macostex-archives/
More information about the macostex-archives
mailing list