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");
}
}
}
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.
Abhishek SainiPosted Mar 31, 2022, 5:21 AM
You can get the answer from this link
https://stackoverflow.com/questions/583629/how-can-i-insert-an-image-with-itextsharp-in-an-existing-pdf
Marvin ReidPosted Mar 30, 2022, 8:27 PM
Raheel AhmadPosted Dec 12, 2018, 2:02 AM
Rahul PrasadPosted Oct 14, 2018, 9:04 PM