using iTextSharp.text; using iTextSharp.text.pdf; // create a new document Document doc = new Document(); // open the document PdfWriter.GetInstance(doc, new FileStream("output.pdf", FileMode.Create)); // add some content doc.Add(new Paragraph("Hello, world!")); // close the document doc.CloseDocument();In this example, we create a new PDF document using the iTextSharp library. We add some content to the document in the form of a paragraph that says "Hello, world!". Then, we call the CloseDocument method to close the document before saving it to a file called "output.pdf". We use the FileStream class to create the output file. Overall, the iTextSharp library provides a powerful set of tools for creating and manipulating PDF documents in C#. The CloseDocument method is just one example of the many useful methods and classes provided by this library.
public CloseDocument ( ) : void | ||
return | void |