Prakash Mondal

Prakash Mondal

  • NA
  • 288
  • 208.5k

How to insert image in pdf file using c# form application?

Oct 13 2018 4:09 AM
I create a pdf file using c# windows form application.
 
source code: 
 
 using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using iTextSharp.text;
using iTextSharp.text.pdf;
using System.IO;

namespace PDFCreater
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)
{
for (int i = 0; i < 3; i++)
{
//Document document = new Document(PageSize.A4.Rotate(), 0, 0, 5, 0);
Document document = new Document(PageSize.A4.Rotate());
PdfWriter.GetInstance(document, new FileStream("E:/a" + i + ".pdf", FileMode.Create));
document.Open();
Paragraph p = new Paragraph("Test:: " + i);
document.Add(p);
document.Close();
}

MessageBox.Show("complete");
}
}
}
 I want to insert image as logo in this pdf file in left side of this pdf page.
 
please help.
 

Answers (4)