Create a .png file at runtime and export.

Hi, I’m currently working on a non game app for my work. At the moment, I’m trying to generate a pdf file at runtime using PDFsharp. However, I thought of an idea and searched the forums and answers to see if it had been done already. Instead of trying to pull image file locations, set scales, set the location of text and draw boxes and blah blah blah.
Is it possible to create a blank letter size image, add more images and text to it, then export the “image” with all it’s other images and text in the correct spots as a .png? C# please.

Hi herCoder,
I know it’s been a while since you opened this thread but I’m interested in it by myself. After some research I found out, that the easiest method is to create a bitmap by width and height and export it with standard c# methods (unity does not have/need any for exporting .png) and combine your letter or other images with it by writing an array of bitmaps and a own method to combine those bitmaps in the right order.
Here is a code for writing and exporting a .png file to any location.

//create the bitmap
    Bitmap bmp = new Bitmap(50,50);
    Graphics g = Graphics.FromImage(bmp);
    
    //paint the bitmap here with g. …
    //I just fill a recctangle here
    g.FillRectangle(Brushes.Green, 0, 0, 50, 50);
    
    //dispose and save the file
    g.Dispose();
    bmp.Save(@"filepath", System.Drawing.Imaging.ImageFormat.Png);
    bmp.Dispose();