Exception with PdfViewer

Questions, comments and suggestions concerning VintaSoft Barcode .NET SDK.

Moderator: Alex

Post Reply
paolozan
Posts: 2
Joined: Tue Jun 22, 2010 10:00 am

Exception with PdfViewer

Post by paolozan »

Good day.
I'm evaluating the latest version of the barcode library with Vs2010 but, I have this exception:
ObjectDisposedException crossed a native/managed boundary - Cannot access a closed stream

in the line
ImgPdf = Pdf.GetImage(0, TmpNomiImmagini[0]);

this is my code:
Image ImgPdf = null;

if (Path.GetExtension(NomeFile).ToUpper() == ".PDF")
{
Vintasoft.Pdf.PdfImageViewer Pdf = new Vintasoft.Pdf.PdfImageViewer(NomeFile);

if (Pdf.PageCount == 0)
{
Pdf.Dispose();
return false;
}

string [] TmpNomiImmagini = Pdf.GetImageNames(0);

if (TmpNomiImmagini.Length == 0)
{
return false;
}

try
{
ImgPdf = Pdf.GetImage(0, TmpNomiImmagini[0]);
}
catch
{
Pdf.Dispose();
return false;
}

Pdf.Dispose();
}

What's wrong ? Thank you. Paolo.
Alex
Site Admin
Posts: 2305
Joined: Thu Jul 10, 2008 2:21 pm

Re: Exception with PdfViewer

Post by Alex »

Hello Paolo,

We cannot reproduce the problem. Please send us a demo project and PDF document to support@vintasoft.com - we need to reproduce the problem.

Best regards, Alexander
Post Reply