DisplayFromByteArray v8

Discussions about document viewing.
Post Reply
mdelbene
Posts: 31
Joined: Wed May 11, 2011 10:03 am

DisplayFromByteArray v8

Post by mdelbene » Fri Jul 01, 2011 6:07 pm

Hi all,
I'm trying to update my application with new version 8 of GdPicture.
When I use the method DisplayFromByteArray to load a document in GdViewer I have an errror.

I searched in new documentation and I wrote a little application with the same GdPicture example code.

Here is the code snippet, that works perfectly with the version 7.4:

Code: Select all

try
			{
				FileInfo fi = new FileInfo(Path.Combine(Environment.CurrentDirectory, "Tulips.jpg"));
				FileStream fs = fi.OpenRead();

				byte[] arr = new byte[fs.Length];


				fs.Read(arr, 0, (int)fs.Length);
				fs.Close();

				this.GdViewer1.DisplayFromByteArray(ref arr);
			}
			catch(Exception ex)
			{
				MessageBox.Show(ex.Message);
				System.Diagnostics.Debug.WriteLine(ex.Message);
			}
This is the error text:
Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection.

With new version I have to use or call first another method?
Thanks a lot.
Michela

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: DisplayFromByteArray v8

Post by Loïc » Fri Jul 01, 2011 9:26 pm

Hi Michela,

Thank you for the report.
We already identified & fixed this problem. We will publish a minor release including the fix on 6th July.

I am sorry for the inconvenient.

With best regards,

Loïc

mdelbene
Posts: 31
Joined: Wed May 11, 2011 10:03 am

Re: DisplayFromByteArray v8

Post by mdelbene » Mon Jul 04, 2011 10:40 am

Thanks for your support.
Michela

EmanueleC
Posts: 11
Joined: Thu Dec 23, 2010 10:53 pm

Re: DisplayFromByteArray v8

Post by EmanueleC » Wed Jul 06, 2011 6:20 pm

I have the same with displayfromstream method. The software worked well in 8 beta.
I load a pdf with GdPicturePDF, manipulate it and then SaveToStream ( a System.IO.MemoryStream) in order to pass it to GdViewer class, but when i use displayfromstream i get that error.

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: DisplayFromByteArray v8

Post by Loïc » Wed Jul 06, 2011 6:23 pm

Hi,

The problem have been fixed. W will publish a new release tomorrow or the day after tomorrow.

Thank you for your comprehension.

Loïc

EmanueleC
Posts: 11
Joined: Thu Dec 23, 2010 10:53 pm

Re: DisplayFromByteArray v8

Post by EmanueleC » Wed Jul 06, 2011 6:28 pm

thanks, i hope tomorrow cause my customer need it, but i know you are great in support.
Just to know, is there another way to pass a pdf from pdf class to viewer, i need to do beacuse with pdf class i manipulate the pdf and with viewer i could print (fast than using imaging with some printer). If you could help with a sample i will modify my software with not worry for that issue.

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: DisplayFromByteArray v8

Post by Loïc » Wed Jul 06, 2011 6:30 pm

A workaround consists to save the stream content to a temporary file and load the PDF from thee file.
Anyway, I suggest you to wait until the next minor release.

mdelbene
Posts: 31
Joined: Wed May 11, 2011 10:03 am

Re: DisplayFromByteArray v8

Post by mdelbene » Mon Jul 11, 2011 9:27 am

Hi Loïc,
I want to update my application with the new GdPicture version that fixes this bug.
I have to download the file gdpicturedotnet.exe from the Download area or there is another place when I can find the new dll?

Thank you!

Michela

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: DisplayFromByteArray v8

Post by Loïc » Mon Jul 11, 2011 9:38 am

Hi,

Now you have to install the package to find the dll.

Kind regards,

Loïc

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest