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.

Explore Data URI Schemes for Embedding Images in PDFs

Ready to Get Started?
Nuget Downloads 15,547,590 | Version: 2025.10 just released