I got the error "A generic error occurred in GDI+. " when I run my code on the production server, but it works fine when run on development server in generating the barcode and then save.
I am sending u the sample code for the analysis, please help if u can.
I am using ASPOSE.Total product.
BarCodeBuilder b = new BarCodeBuilder();
b.SymbologyType = Aspose.BarCode.Symbology.Code39Standard;
b.CodeText = BarcodeText;
b.Save(Server.MapPath("~/Module/Reports/Temp/Barcode.jpg"), System.Drawing.Imaging.ImageFormat.Jpeg);
b.Dispose();
I got the error on the red line.
Munendra Maheshwari
Hi Munendra,
Thanks for considering Aspose.
Could you please mention the details of the development and production environment e.g. Operating System and .NET version. Please also mention if you are using 32 or 64-bit Windows in development/production system.
I would like to test the same code in a similar environment for reproducing the issue and finding some solution to the problem.
Hi Munendra,
Thanks for providing the information.
We have reproduced the error. It occurs when you generate barcode in 64 bit Windows. We have logged this issue in our bug tracking system and notify you when there is a workaround or fix for this issue. Sorry the the inconvenience.
Hi saqib.razzaq,
I wanna remind u again about my problem. I am waiting for your positive answer, Sir.
Have u find any solution to overcome this problem...
Munendra Maheshwari
Hi,
We are still trying to fix this problem. Thanks for your patience.
Hi Munendra,
We just found out that the exception occurred due to security restrictions. The IUSR_MachineName should have write access on the directory where you want to save the image files.
Just to verify, please run the simple code below to create and save a bitmap image.
<span style=“font-size: 10pt; font-family: “Verdana”,“sans-serif”; color: blue;”>System.Drawing.Bitmap bm = new Bitmap(200,200);<span style=“font-size: 12pt; font-family: “SimSun”,“serif”;”><o:p></o:p>
bm.Save(Server.MapPath("TestSave.jpg"),
System.Drawing.Imaging.ImageFormat.Jpeg);
It can be fixed by setting the permissions in IIS Manager. Please let me know if it works for you.
Thanx saqib,
Its working now. Very very thanx for ur kind and appreciable suggestion.
Saqib, I have another issue also posted on this link below...
<A href="https://forum.aspose.com/t/122778</A></P>
<P>can u help or suggest me for this.</P>
<P>Reply ASAP</P>
Hi Munendra,
I handle BarCode and Network products. I am sure that you will get solution soon by the relevant guys there.