Embedding Bitmaps and Images
When you want to embed an image in HTML using Base64 encoding, you need to acquire the binary data of the image either by reading the image file or receiving it through a network request. In this example, we have imported the image we want to use and acquired its binary data. Then, using the Convert.ToBase64String
method, we successfully converted it to Base64. Through this method, you will be able to add your images to any HTML content that you are using to render PDF documents.
For a more comprehensive guide, including additional examples and sample code, visit this How-to Guide.
Discover how to efficiently use Data URIs for embedding images in PDFs with our detailed guide.