Bug 40699 - [PATCH] Invalid PDF for certain numerical values in SVG lineargradient
Summary: [PATCH] Invalid PDF for certain numerical values in SVG lineargradient
Status: CLOSED FIXED
Alias: None
Product: Fop - Now in Jira
Classification: Unclassified
Component: svg (show other bugs)
Version: trunk
Hardware: All Windows XP
: P3 normal
Target Milestone: ---
Assignee: fop-dev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-10-06 15:33 UTC by Michael Bartmann
Modified: 2012-06-01 14:52 UTC (History)
0 users



Attachments
SVG file causing the prolem when used with docbook/fop (603 bytes, image/svg+xml)
2006-10-06 15:35 UTC, Michael Bartmann
Details
patch that fixes issue (775 bytes, patch)
2012-05-13 22:04 UTC, Luis Bernardo
Details | Diff
output PDF of test case after fix (162.34 KB, application/pdf)
2012-05-13 22:07 UTC, Luis Bernardo
Details
test FO file that uses given SVG file (540 bytes, application/octet-stream)
2012-05-13 22:44 UTC, Luis Bernardo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Bartmann 2006-10-06 15:33:35 UTC
I use fop built from a recent source snapshot, as the svn access fails for me.
The specific version I use is fop_trunk_20061004042355.
I have a small svg file with only one path using a lineargradient, which
for certain numerical values generates pdf which make acroat complain:
"Ein nicht erkannter token "1.999999137575E-05" wurde gefunden"
(this is german locale for "An unknown token ... was found").
The exact numerial value of thi error message varies when certain
coordinates in the path are modified.

The path is a simple triangle, the x-coordinate of the first/last point
is 0.0001; There is no error when I change this to 0.001.
The opacity of the first stop in the linear gradient is 0.9; There is no
error when I change this to 1.
Comment 1 Michael Bartmann 2006-10-06 15:35:55 UTC
Created attachment 18975 [details]
SVG file causing the prolem when used with docbook/fop
Comment 2 Michael Bartmann 2006-10-07 10:13:43 UTC
I must admid, that I am not able to determine whether this might also
be a bug in acrobat reader 7. There is no waterproof evidence that the problem
is in fop. But then again...
Comment 3 Luis Bernardo 2012-05-13 22:04:18 UTC
Created attachment 28770 [details]
patch that fixes issue

The issue was being caused by small decimal numbers that were being output in scientific notation (which is is not valid in PDF). The patch addresses and fixes this particular issue.
Comment 4 Luis Bernardo 2012-05-13 22:07:12 UTC
Created attachment 28772 [details]
output PDF of test case after fix
Comment 5 Luis Bernardo 2012-05-13 22:44:00 UTC
Created attachment 28773 [details]
test FO file that uses given SVG file
Comment 6 Glenn Adams 2012-05-16 01:13:40 UTC
patch applied at http://svn.apache.org/viewvc?rev=1338967&view=rev

thanks luis and michael!

please review and close if satisfied