Use iTextSharp to process PDFs

Create PDF files using System; using System.Collections.Generic; using System.Text; using iTextsharp.text; using iTextsharp.text.pdf; using System.IO; using System.Windows.Forms; namespace ConsoleApplication4 { class Program { static void Main(string[] args) { iTextsharp.text.Document pdf doc new Document(); Pdfwriter pdf write Pdfwriter.GetInstance(pdf doc,new Filestream(@”I:\chap1.pdf”,FileMode.Create)); pdfdoc.Open() pdf doc.Add(new Paragraph (“new pdf!”)); pdf doc.close(); MessageBox.Show (“OK!”,Environment.UserName); Console.Read(); } } } Use iTextSharp […]

C# itextsharp print pdf

When it comes to printing, I am afraid that many people are familiar with it. Both developers and non-computer professionals will be exposed to printing. There are many places where printing is used in project development. In .NET projects, there are many ways to choose printing, such as original IE web page printing, crystal report, […]

Use iTextSharp footer, add horizontal line

//font Font font = new Font(BaseFont.CreateFont(“font file path”, BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED), 24, Font.BOLD)); Document document = new Document(PageSize. A4); document.SetMargins(55, 55, 38, 70);//Margin settings: left, right, top, bottom PdfWriter writer = PdfWriter.GetInstance(document, new FileStream(“Full path and name of the generated PDF file”, FileMode.Create)); SetFooter(writer);//Set footer (including header) document. Open(); // Initialize header form PdfPTable headTable = […]

VS2017 uses the NuGet plug-in to convert CSV format files into pdf files using iTextSharp and Aspose.Words.

NuGet download and installation reference: Visual Studio NuGet offline installation package_visual studionuget package offline download_Su Shoukun’s Blog-CSDN Blog iTextSharp installation: first step: Step two: Aspose.Words installation: It is also downloaded in NuGet. The above are all operations for finding files. For specific installation operations, see here. This uses iTextSharp as an example, and Aspose.Words will […]

C# Json data to DataTable and generate PDF online download–iTextSharp generates PDF instance (file download, json data conversion, PDF typesetting in one step)

Foreword This article will focus on the use of iTextSharp and some pitfalls that are easy to step on. By the way, it will introduce the simple, fast and efficient method of converting json to DataTable and the method of online instant download of binary stream conversion files. After testing, it only takes 1 second […]

C# implements keyword signature and stamping through iTextSharp (by inserting stamped pictures in the content)

This function reads the PDF document information through iTextSharp, and searches for each page of the PDF file in a loop. As long as it meets the conditions in the entire PDF, it will be stamped. For example, only the last page needs to be stamped. Please remove the For loop in the method, and […]