xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thomas.dewe...@kodak.com
Subject Re: Filling a rectangle with a tiled pattern of .png files
Date Thu, 03 Apr 2008 10:27:30 GMT
Hi Lea,

Lea Thurman <lea.thurman@onesoon.co.uk> wrote on 03/31/2008 04:59:00 PM:

> I am trying to fill a rectangle by tiling a .png image.

> However I am getting the following error:
> java.net.MalformedURLException: no protocol: defs.svg#fpatid

   This looks to me like somehow you aren't setting the
base URL of the document correctly.  Are you building the
DOM dynamically?  Or are you providing an input stream with
a 'URI' to the XML Parser?  If so you need to replace the
text "defs.svg" with a properly formatted URL (like
"file:///defs.svg"

   Once that is fixed I still don't think it will render right
(see below).

> I am not sure how to reference the pattern in fill attribute in the
> rectangle.
> After looking at the specification I got as far as rendering the
following svg:

> <?xml version="1.0" encoding="UTF-8"?>
> <svg height="297mm" width="210mm">
>     <pattern width="0.5in" x="0.5in" height="0.5in" id="fpatid"
>         y="0.5in"
> xlink:href="file:///volumes/pbook/users/user/images/image.png"/>

   The SVG pattern element doesn't have an xlink:href attribute.
You will need to have an 'image' element under the pattern, something
like:

   <pattern id="fpatid" x="0.5in" y="0.5in" width="0.5in" height="0.5in">
      <image x="0" y="0" width=".5in" height=".5in"

xlink:href="file:///volumes/pbook/users/user/images/image.png"/>
   </pattern>
Mime
View raw message