Exception in PrintBySize

Discussions about document printing in GdPicture.NET using GdPictureImaging.
Post Reply
pyh
Posts: 5
Joined: Mon Nov 09, 2009 5:01 pm

Exception in PrintBySize

Post by pyh » Thu Aug 12, 2010 3:01 pm

Hi, I have an error when I'm trying to print image from programm.
Exception ‘InvalidPrinterException’ - “No Printers are installed.” throws in method PrintBySize. In other programs (Paint for example) I can print without these error.

GDPicture version: 6.7.0.8
Framework version: 3.5
My printer sets as default.

Exception info:
System.Drawing.Printing.InvalidPrinterException occurred
Message="Установленные принтеры не обнаружены."
Source="System.Drawing"
StackTrace:
в System.Drawing.Printing.StandardPrintController.OnStartPrint(PrintDocument document, PrintEventArgs e)
в System.Drawing.Printing.PrintController.Print(PrintDocument document)
в System.Drawing.Printing.PrintDocument.Print()
в Ꮫ.ᡲ.᤯(Int32 ᤰ, Single ᤱ, Single ᤲ, Single ᤳ, Single ᤴ, Boolean ᤵ)
в Ꮫ.ᡲ.ᣱ(Int32 ᣲ, Single ᣳ, Single ᣴ, Single ᣵ, Single ᣶)
в GdPicture.GdPictureImaging.PrintBySize(Int32 ImageID, Single DstLeft, Single DstTop, Single Width, Single Height)
в Chocolography.Printing.PrintingHelper.PrintImage(Bitmap imageToPrint) в H:\_src\Chocolography Printing Studio\Chocolography Printing Studio\Printing\PrintingHelper.cs:строка 153
InnerException:

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

Re: Exception in PrintBySize

Post by Loïc » Fri Aug 13, 2010 2:12 pm

Hi,

Which code are you using to reproduce this error ?

Kind regards,

Loïc

pyh
Posts: 5
Joined: Mon Nov 09, 2009 5:01 pm

Re: Exception in PrintBySize

Post by pyh » Fri Aug 13, 2010 4:01 pm

Loïc wrote:Hi,

Which code are you using to reproduce this error ?

Kind regards,

Loïc
Hi, Loïc. It's very simple code:

Code: Select all

var imageId = 0;
var oGdPictureImaging = new GdPicture.GdPictureImaging();
oGdPictureImaging.SetLicenseNumber(GdLicenseNumber);
var gdiBitmap = imageToPrint.ToGdiplusBitmap();
imageId = oGdPictureImaging.CreateGdPictureImageFromBitmap(gdiBitmap);
oGdPictureImaging.PrintSetShowPrintingProgress(false);
oGdPictureImaging.PrintSetDocumentName(ProjectData.ProjectName); 
oGdPictureImaging.PrintBySize(imageId, 0, 0, PrintingHelper.PalletWidthInch, PrintingHelper.PalletHeightInch); // !!! exception
But this exception appears only on specified printer "Encad CadJet T-200" other printers works well with this code.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest