[xep-support] Order of region background-color in PDF output from regions is non-deterministic
Jason Zaugg
jzaugg at gmail.com
Wed Feb 6 05:53:02 PST 2008
I have recently updated my layouts to use a white page background
color. Before, the documents were transparent, and this looks ugly in
certain PDF viewers.
My reading of the XSL spec suggested that I should to apply
background-color='white' to all regions. This indeed fixed the visual
problem.
The page master now looks like this:
<fo:simple-page-master master-name="pagemaster1" page-height="845.0pt"
page-width="598.0pt" margin-top="10.0pt" margin-left="10.0pt"
margin-bottom="10.0pt" margin-right="10.0pt">
<fo:region-body background-color='white' margin-left="28.0pt"
margin-top="28.0pt" margin-bottom="28.0pt" margin-right="28.0pt"/>
<fo:region-before background-color='white' extent="28.0pt" precedence="true"/>
<fo:region-after background-color='white' extent="28.0pt" precedence="true"/>
<fo:region-start background-color='white' extent="28.0pt" precedence="false"/>
<fo:region-end background-color='white' extent="28.0pt" precedence="false"/>
</fo:simple-page-master>
Is this the simplest way to acheive a white page background?
Unfortunately, the PDF output from XEP for Java version Version 4.10
now varies each time it is run. While there are no visual differences,
the unstable output makes it more difficult to test that two PDFs are
identical. I'd guess that the white rectangles for each region are
being sorted based on Java object ID somewhere, and hence are output
in an instable order.
We are able to run a tool to visually compare the PDFs as a
workaround, but this is much slower than comparing the PDF bytes
(stripped of CreationDate / ModDate / ID fields)
Is it possible to update XEP to make the PDF output predictable?
Regards,
Jason
result-1.pdf snippet:
%PDF-1.4
%âãÏÓ
5 0 obj
<</Length 6 0 R
>>
stream
1 G
1 g
10 38 m
10 807 l
38 807 l
38 38 l
h
f
10 10 m
10 38 l
588 38 l
588 10 l
h
f
10 807 m
10 835 l
588 835 l
588 807 l
h
f
560 38 m
560 807 l
588 807 l
588 38 l
h
f
38 38 m
38 807 l
560 807 l
560 38 l
h
f
-------------------------------
Result-2.pdf snippet
%PDF-1.4
%âãÏÓ
5 0 obj
<</Length 6 0 R
>>
stream
1 G
1 g
560 38 m
560 807 l
588 807 l
588 38 l
h
f
10 38 m
10 807 l
38 807 l
38 38 l
h
f
10 807 m
10 835 l
588 835 l
588 807 l
h
f
10 10 m
10 38 l
588 38 l
588 10 l
h
f
38 38 m
38 807 l
560 807 l
560 38 l
h
f
-------------- next part --------------
A non-text attachment was scrubbed...
Name: address.xml
Type: text/xml
Size: 1496 bytes
Desc: not available
URL: <http://lists.renderx.com/pipermail/xep-support/attachments/20080206/614b6fc1/attachment.xml>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: white-background-regions-layout.xsl
Type: text/xml
Size: 3461 bytes
Desc: not available
URL: <http://lists.renderx.com/pipermail/xep-support/attachments/20080206/614b6fc1/attachment-0001.xml>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: result-1.pdf
Type: application/pdf
Size: 3919 bytes
Desc: not available
URL: <http://lists.renderx.com/pipermail/xep-support/attachments/20080206/614b6fc1/attachment.pdf>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: result-2.pdf
Type: application/pdf
Size: 3919 bytes
Desc: not available
URL: <http://lists.renderx.com/pipermail/xep-support/attachments/20080206/614b6fc1/attachment-0001.pdf>
More information about the Xep-support
mailing list