GdViewer PrintShowPrinterSettingsDialog error

Discussions about document viewing.
Post Reply
jeanleno
Posts: 5
Joined: Wed Oct 26, 2016 1:03 pm

GdViewer PrintShowPrinterSettingsDialog error

Post by jeanleno » Wed Oct 26, 2016 1:29 pm

Hi!

I am getting this error when I call the GdViewer.PrintShowPrinterSettingsDialog method.
See below:

An unexpected error has ocurred.
System.Threading.ThreadExceptionEventArgs

System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
at GdPicture12.Internal.Printing.GdPicturePrinting.ᜀ.gdpicture_ᜀ(IntPtr A_0, IntPtr A_1, String A_2, IntPtr A_3, IntPtr& A_4, Int32 A_5)
at GdPicture12.Internal.Printing.GdPicturePrinting.ᜀ.ᜀ(IntPtr A_0, String A_1)
at GdPicture12.Internal.Printing.GdPicturePrinting.gdpicture_ᜀ(IntPtr A_0)
at PdfViewerNS.PrintWindow.btnPropriedades_Click(Object sender, EventArgs e)

I have a GdViewer showing a PDF file that I want to print.
This error occurs only in some machines, mainly Windows 8 and Windows 10, but not all, and I don't know the reason.

My code is similar to example

This is the method to select the printer:

private void cbxPrinters_SelectedIndexChanged(object sender, EventArgs e)
{
bool ok = gdPicturePrinter.viewer.PrintSetActivePrinter(cbxPrinters.Text);
}

This is the method to show printer settings:

private void btnPropriedades_Click(object sender, EventArgs e)
{
var res = gdPicturePrinter.viewer.PrintShowPrinterSettingsDialog(this.Handle);
if (res != GdPictureStatus.OK)
{
//MessageBox.Show(res.ToString());
}
}

Can someone help me?

Cedric
Posts: 269
Joined: Sun Sep 02, 2012 7:30 pm

Re: GdViewer PrintShowPrinterSettingsDialog error

Post by Cedric » Thu Nov 03, 2016 4:15 pm

We haven't been able to reproduce this behavior as of now despite multiple tests.
Please open a ticket on the support platform so we can investigate this further.

jeanleno
Posts: 5
Joined: Wed Oct 26, 2016 1:03 pm

Re: GdViewer PrintShowPrinterSettingsDialog error

Post by jeanleno » Fri Nov 04, 2016 12:33 pm

Hi Cedric

I solved my problem changing the method call from gdPicturePrinter.viewer.PrintShowPrinterSettingsDialog(this.Handle) to gdPicturePrinter.viewer.PrintShowPrinterSettingsDialog()

I don't know why, but this worked for me.

Anyway, thanks!

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest