Articles in this section
Category / Section

How to insert an image in WinForms PDF?

1 min read

You can insert an image into the Winforms PDF by using the BackgroundImage property in the cell style.

You can refer to the following code example to insert an image into the grid.

C#

// Creates the PdfGrid
PdfGrid pdfGrid = new PdfGrid();
// Adds the columns
pdfGrid.Columns.Add();
pdfGrid.Columns.Add();
// Adds the row and value to the cell
for (int i = 0; i < 10; i++)
{
    PdfGridRow pdfGridRow = pdfGrid.Rows.Add();
    pdfGridRow.Cells[0].Value = "Syncfusion";
    pdfGridRow.Cells[1].Value = "Software";
}
// Applies the image 
PdfBitmap pBmp = new PdfBitmap(@"..\..\Data\logo.png");
pdfGrid.Rows[0].Cells[0].Style.BackgroundImage = pBmp;
pdfGrid.Rows[0].Cells[0].Value = "";
// Draws the grid
pdfGrid.Draw(page, new PointF(0, 0));

Sample Link

https://www.syncfusion.com/downloads/support/directtrac/general/PdfGridSample-2137715442.zip


Conclusion

I hope you enjoyed learning about how to insert an image into WinForms PDF.

You can refer to our WinForms PDF feature tour page to learn about its other groundbreaking features. You can also explore our documentation to understand how to create and manipulate data.

For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums or feedback portal. We are always happy to assist you!

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments
Please  to leave a comment
Access denied
Access denied