Hi
, I've a lot of (incorrect) ps-files produced from a foreign app. The files
have BoundingBox values like:
%%BoundingBox: 0.0 0.0 139.0 25.823999999999998
I know that it isn't conform with the spec, which requires
%%HiResBoundingBox for floating point values, but I think it is a little bit
to restrictive to ignore this file totally on rendering (Image Area has 0x0
dimension).
I think we should warn the user, that the postscript file has a failure, but
we should preserve the space in the document with round off Integers.
Here is the modified code, which seems to be working fine.
// ----- code snip
private int readLongString(long[] mbbox, int i, int idx) {
while (idx < epsFile.length &&
(epsFile[idx] == 32))
idx++;
int nidx = idx;
while (nidx < epsFile.length &&
((epsFile[nidx] >= 48 && epsFile[nidx] <= 57) ||
(epsFile[nidx] == 45) || (epsFile[nidx] == 46) ))//here check
also for ANSI46(".") to identify floating point values
nidx++;
byte[] num = new byte[nidx - idx];
System.arraycopy(epsFile, idx, num, 0, nidx-idx);
String ns = new String(num);
if( ns.indexOf(".") > -1 )
{
//here do something like logging a warning
}
mbbox[i] = (long) Math.ceil( Double.parseDouble( ns ) );//then parse
the
double and round off to the next math. Integer
return (1 + nidx - idx);
}
// ----- end code snip
It were great if any commiter can put this into the original file.
cu Torsten
-------------------------------------------------------------------------
Unless otherwise indicated, this e-mail and any attachments hereto contain
information which is confidential and/or protected by intellectual property
rights and are intended for the sole use of the recipient(s) named above
under terms of confidentiality nd non-use agreements. Any use of the
information contained herein (including, but not limited to, total or
partial reproduction, communication or distribution in any form) by persons
other than the designated recipient(s) or for purposes not permitted by such
agreements, is prohibited. If you have received this e-mail in error, please
notify the sender either by telephone or by e-mail and delete the material
from any computer. Thank you for your cooperation.
-------------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]