Bug 24666 - fo:instream-foreign-object: SVG w/6-digit translates not rendering well
Summary: fo:instream-foreign-object: SVG w/6-digit translates not rendering well
Status: CLOSED FIXED
Alias: None
Product: Fop - Now in Jira
Classification: Unclassified
Component: svg (show other bugs)
Version: trunk
Hardware: Other other
: P3 normal
Target Milestone: ---
Assignee: fop-dev
URL:
Keywords:
: 23883 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-11-12 23:19 UTC by Glen Mazza
Modified: 2012-04-01 07:04 UTC (History)
1 user (show)



Attachments
SVG file that renders correctly w/Squiggle application. (37.84 KB, text/plain)
2003-11-12 23:20 UTC, Glen Mazza
Details
Equivalent FO file (does not render correctly.) (38.52 KB, text/plain)
2003-11-12 23:21 UTC, Glen Mazza
Details
0.20.5 FOP output (1.0 very similar), before applying patch (46.61 KB, application/octet-stream)
2003-11-12 23:23 UTC, Glen Mazza
Details
Result in 0.20.5 after patch applied. (46.60 KB, application/octet-stream)
2003-11-12 23:23 UTC, Glen Mazza
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Glen Mazza 2003-11-12 23:19:44 UTC
Tom Vijlbrief has found errors with SVG containing 6-digit translates embedded 
within FOP 0.20.5 (<fo:instream-foreign-object>) (Problem is also relevant for 
1.0).  The SVG renders fine with Batik's squiggle application (shows a 
neighboorhood map.)  

1st attachment -- SVG file (view via Squiggle).
2nd attachment -- FO file (which has above, plus one red & one blue rectangle 
for testing.)
3rd attachment -- (bad) PDF result

For 0.20.5, he has proposed this change to the PDFNumber.java class, which he
believes will accomodate PDFNumber receiving doubles in scientific notation 
(e.g., 1E-04).  (unsure of the validity of this.)

public class PDFNumber {
    static java.text.DecimalFormat myFormatter = new java.text.DecimalFormat
("#.########");
    public static String doubleOut(Double doubleDown) {
        return doubleOut(doubleDown.doubleValue());
    }
    public static String doubleOut(double doubleDown) {
        return myFormatter.format(doubleDown);
    }
    public static String doubleOut(double doubleDown, int dec) {
        return doubleOut(doubleDown);
    }
    ... other methods in 1.0...
}

The new class appears to fix the problem when applied to 0.20.5, however will 
*not* work with nightly build of maintenance (has a different Batik library).  
Nor will it work with 1.0, because of the (even newer) Batik library in HEAD 
(as well as perhaps other reasons, 1.0 being incomplete).

Another possible problem with the above patch is that it neutralizes the third 
method in the class (just calls the second method, # decimal points desired is 
ignored).  I'm unsure how important the third method is to FOP.

4th attachment -- PDF result from 0.20.5 modified with PDFNumber as above.  
Renders well

Thomas DeWeese (Batik) commented on this problem earlier, prior to Tom 
Vijlbrief's patch:
see http://marc.theaimsgroup.com/?l=fop-dev&m=106709286423914&w=2.

Will keep this bug open for 1.0 to ensure that these types of SVG's can be 
generated in the new 1.0 version of FOP.  Also, the rendering is usually worse 
in Acrobat Reader 5.0 vs. AR 6.0, so recommended to make sure changes render 
correctly at least in AR 6.0.
Comment 1 Glen Mazza 2003-11-12 23:20:43 UTC
Created attachment 9080 [details]
SVG file that renders correctly w/Squiggle application.
Comment 2 Glen Mazza 2003-11-12 23:21:38 UTC
Created attachment 9081 [details]
Equivalent FO file (does not render correctly.)
Comment 3 Glen Mazza 2003-11-12 23:23:21 UTC
Created attachment 9082 [details]
0.20.5 FOP output (1.0 very similar), before applying patch
Comment 4 Glen Mazza 2003-11-12 23:23:45 UTC
Created attachment 9083 [details]
Result in 0.20.5 after patch applied.
Comment 5 Glen Mazza 2003-11-12 23:40:29 UTC
*** Bug 23883 has been marked as a duplicate of this bug. ***
Comment 6 Pascal Sancho 2007-11-20 00:56:14 UTC
Fixed in FOP 0.94 and probably earlier versions
Comment 7 Glenn Adams 2012-04-01 07:04:17 UTC
batch transition pre-FOP1.0 resolved+fixed bugs to closed+fixed