he Paragraph is a subclass of Phrase and represents the paragraph of the text. Using Paragraph class we can manage paragraph alignment, spacing etc. It is represented by com.itextpdf.text.Paragraph class.
Steps:
1. Create Document instance. It represents the current document to which we are adding content.
2. Create OutputStream instance. It represents the generated pdf.
3. Create PDFWriter instance and pass Document and OutputStream instance to its constructor.
4. Open the Document by calling document.open().
5. Add the content to the document by calling document.add() method using Paragraph objects.
6. Close the document by calling document.close() method.
2. Create OutputStream instance. It represents the generated pdf.
3. Create PDFWriter instance and pass Document and OutputStream instance to its constructor.
4. Open the Document by calling document.open().
5. Add the content to the document by calling document.add() method using Paragraph objects.
6. Close the document by calling document.close() method.
Example:
PDFParagraphExample.java
No comments:
Post a Comment