Solved

A generic error occurred in GDI+.

Posted on 2013-11-20
3
28 Views
Last Modified: 2015-06-24
Hi,

I am converting a string to Barcode. Here is my function :

 public void GenerateBarCode(string codeword, string FareCardID, string ClientNm)
        {

            string Code = codeword; // "12345678"; //Request["code"].ToString();
            int w = Code.Length * 40;
            Bitmap oBitmap = new Bitmap(w, 100);
            Graphics oGraphics = Graphics.FromImage(oBitmap);
            Font oFont = new Font("IDAutomationHC39M", 18);
            PointF oPoint = new PointF(2f, 2f);
            SolidBrush oBrushWrite = new SolidBrush(Color.Black);
            SolidBrush oBrush = new SolidBrush(Color.White);
            oGraphics.FillRectangle(oBrush, 0, 0, w, 100);
            oGraphics.DrawString("*" + Code + "*", oFont, oBrushWrite, oPoint);

         
            oBitmap.Save(Server.MapPath("~/Images/Code5.Jpeg"),        System.Drawing.Imaging.ImageFormat.Jpeg);

            GetImage(FareCardID, ClientNm);

        }


This is working fine when I am debugging inside visual studio 2008 on Windows Server 2008 R2 64 bit machine
but when I build and configure it on IIS 7.5 it is giving following error Generic GDI+ error.

It is giving throwing error on the following line

oGraphics.DrawString("*" + Code + "*", oFont, oBrushWrite, oPoint);

Please help

Thanks
0
Comment
Question by:shahjagat
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 39665715
The obvious question would be, "Is the font installed on the server?"
0
 

Accepted Solution

by:
shahjagat earned 0 total points
ID: 39669771
We resolved it. The problem was with permissions for image folder.
0
 

Author Closing Comment

by:shahjagat
ID: 40848143
Issue fixed by us.
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question