Rotate base64 string/ gif before printing

I'm using the UPS developer api to print shipping labels.
The label is returned in a Base64String.

I convert the Base64 to an image and then print the image with print document.

The image is sideways and needs to be rotated clockwise.

How should I go about doing that?
Who is Participating?
käµfm³d 👽Connect With a Mentor Commented:
Use the RotateFlip method of the Image class:


byte[] imgData = Convert.FromBase64String("the base-64 string");
System.IO.MemoryStream ms = new System.IO.MemoryStream(imgData);

using (System.Drawing.Image img = System.Drawing.Image.FromStream(ms))

    // print the image

Open in new window

JRockFLAuthor Commented:
Perfect! That worked. Now I can stop messing around.
Thank you.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.