IS it a known issue that the "filepath" of an image element cannot contain a URL:
Dim MyImage As Image = New Image(ImgSrc, CurrentX, CurrentY)
(where ImgSrc="http://www.mysite.com/images/1.jpg")
is there a workaround?
thanks
URI not allowed
Re: URI not allowed
Support · Feb 18, 2008Hello,
Yes, you can not use the url in the image object's constructor. There is a work around for this is by creating a byte array of the image data using the WebClient class of the .NET. You can use this byte array to create the image. Following is some sample for this.
WebClient wc = new WebClient();
byte[] ReadByteBuffer = wc.DownloadData(url);
Image image = new Image(ImageData.GetImage(ReadByteBuffer), 0, 0);
Thanks,
ceTe Software Support Team.
Re: URI not allowed
Forum member · Feb 18, 2008would you have something in VB....
thanks
Re: URI not allowed
Support · Feb 18, 2008Hello,
Following is the VB.Net code.
Dim MyWebClient As New WebClient()
Dim MyReadByteBuffer As Byte() = MyWebClient.DownloadData(url)
Dim MyImage As New Image(ImageData.GetImage(MyReadByteBuffer), 0, 0)
In order to use the WebClient class you will have to import the System.Net namespace.
Imports System.Net
Thanks,
ceTe Software Support Team.
Re: URI not allowed
Forum member · May 15, 2008Using DynamicPDF for .NET 2.0 - Server Edition, Version 4.0.3.20
and
WebClient wc = new WebClient();
byte[] ReadByteBuffer = wc.DownloadData(url);
Image image = new Image(ImageData.GetImage(ReadByteBuffer), 0, 0);
Error: The name 'ImageData' does not exist in the current context
Missing namespace or ???
thanks
Re: URI not allowed
Support · May 15, 2008Hello,
ImageData class is a member of ceTe.DynamicPDF.Imaging namespace. You will have to import the ceTe.DynamicPDF.Imaging namespace in order to use the ImageData class.
Thanks,
ceTe Software Support Team.