UriFormatException on calling Render()


I am calling FonetDriver.Render with an input MemoryStream containing the fo:root XML and expecting to get a rendered PDF in the output Stream. But I'm getting an exception instead:

System.UriFormatException occurred
Message=Invalid URI: The hostname could not be parsed.
   at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind)
... I can't see what URI it might be worried about apart from the input XML does have an image embedded like this:
      <fo:external-graphic src="url('file://http://mywebsite.co.uk/mylogo.gif')"/>
... However that gif is definitely accessible (not actual uri shown btw).

Here's the VB code I am using to call Render():

Dim output As System.IO.MemoryStream = New System.IO.MemoryStream
Dim driver As Fonet.FonetDriver = Fonet.FonetDriver.Make()
driver.CloseOnExit = False
input.Position = 0
driver.Render(input, output)

... this last line gives the exception.

Any help gratefully received.

Thanks, J


JamesLC wrote Dec 6, 2013 at 11:49 AM

The answer is that the image URI should not contain "file://".