Test in production without watermarks.
Works wherever you need it to.
Get 30 days of fully functional product.
Have it up and running in minutes.
Full access to our support engineering team during your product trial
In this tutorial, we explore the process of using Iron PDF to draw text and bitmap images on PDFs in a C# console application. The video starts with the installation of Iron PDF via the NuGet package manager. We then move into coding, starting with including necessary namespaces such as Iron PDF, Iron Software.Drawing, and System.IO. After adding a license key for Iron PDF, we initialize a ChromePdfRenderer object to convert HTML content, specifically a header tag, into a PDF document.
The tutorial demonstrates how to add text to the PDF using the DrawText method, specifying parameters like font type, size, page index, coordinates, color, and rotation angle. Text is added using the Times New Roman font, size 12, positioned on the first page at coordinates (100, 100), in black color.
Next, the tutorial guides you on how to add an image to the PDF. An image named IronSoftware.PNG is loaded from a specified path using Bitmap.FromFile. The DrawBitmap method is employed to position the image on the first page at coordinates (50, 250), scaled to dimensions of 500x300 pixels.
Finally, the PDF is saved using the SaveAs method with a specified file path. The tutorial concludes by running the project to verify the output, showcasing the added text and image in the PDF. This tutorial demonstrates the simplicity and efficiency of using Iron PDF for PDF manipulation in a C# console application. For more tutorials and a trial subscription, viewers are encouraged to subscribe and visit the provided link.
Further Reading: How to Draw Text and Bitmap on PDFs