Does the API support adding an annotation to an image?
Load image
Add annotation (such as Text)
Save Image with annotation
Thanks
Does the API support adding an annotation to an image?
Load image
Add annotation (such as Text)
Save Image with annotation
Thanks
Hi Parakash,
Thanks Babar,
Your links helped me to use Graphics to write Text onto an image that I loaded from a file.
I am looking for some help on the Aspose.Imaging.Font class.
I need to construct a Font "Courier New" Font Size is 12
Both font name and size are being read from a table and can vary for each line that I am writing.
I am a bit lost is the em-size parameter and the graphics.unit parameter.
Thanks
Parkoos
Hi Parkoos,
Babar,
I am trying to get Courier New, 12 point font working. I am attaching 2 files, FormTestBasic.tif and FormTestBasic.docx.
The DOCX file is Courier New, 12 point. Note the difference from the TIF file.
My question - the TIF does no seem to be in 12 point font. Thanks for your help.
Here is my code
//Create an instance of Image
Aspose.Imaging.ImageOptions.TiffOptions tiffOptions = new Aspose.Imaging.ImageOptions.TiffOptions();
tiffOptions.Source = new Aspose.Imaging.Sources.StreamSource(fs);
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Create(tiffOptions, 1710, 2190))
{
Aspose.Imaging.License license = new Aspose.Imaging.License();
license.SetLicense(“Aspose.Imaging.lic”);
//Create and initialize an instance of Graphics class
Aspose.Imaging.Graphics graphic = new Aspose.Imaging.Graphics(image);
Aspose.Imaging.Brushes.SolidBrush brush;
graphic.Clear(Aspose.Imaging.Color.White);
// write text
FormElement formElement = new FormElement();
Aspose.Imaging.Font aspFont = new Aspose.Imaging.Font(“Courier New”, 12, Aspose.Imaging.FontStyle.Bold, Aspose.Imaging.GraphicsUnit.Point);
brush = new Aspose.Imaging.Brushes.SolidBrush(Aspose.Imaging.Color.Black);
Aspose.Imaging.Point aspPoint = new Aspose.Imaging.Point(200, 400);
string sWriteThis = “LAU,JOSEPH 58763258 03/27/2014 03/27/2014 21210950”;
graphic.DrawString(sWriteThis, aspFont, brush, aspPoint);
// save all changes.
image.Save(fs);
fs.Dispose();
}
Please ignore the FormElement line just below // write text - its a left over from my real code and is not used here.
Also note that there are spaces in the sWriteThis and it has been removed by the html in this post.
Parkoos
Hi Parkoos,
Babar,
I did some testing with the fonts specified in your Hello World attachment above.
I create a WORD doc file with each font - same as your Hello World. it is attached.
If you notice, it is quite different from the Hello World image in the above post.
The fonts get increasingly larger as one would expect from an increasing font size.
Could there be an issue within Aspose Imaging?
Regards
Parkoos
Hi Parkoos,
Thanks Babar.
Looks like using a Graphics brush to write strings on an image is not the way to solve the issue of overlaying a form image with data.
I will be looking into other imaging tools that support Annotations.
Regards
Parkoos