This project is read-only.

Invalid URI exception

Dec 5, 2013 at 3:13 PM
Edited Dec 6, 2013 at 12:09 PM
I've now copied this into the ISSUES section as I've had no reply...

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
HResult=-2146233033
Message=Invalid URI: The hostname could not be parsed.
Source=System
StackTrace:
   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
Dec 6, 2013 at 12:48 PM
The answer is that the image URI should not contain "file://".
Marked as answer by JamesLC on 12/6/2013 at 4:48 AM