We wanted to get to an end result where the packet would be a single PDF, so it would be easier to store and would require only one print job, so there was no chance of part of it being lost. The client had each piece of the policy either in a static PDF or in a file that would be dynamically converted to PDF. On a recent project, I was given the requirement of assembling large policy packets for an insurance client. You can see the results in Figure 4-26, where both chunks have their respective fonts. Let’s create a couple of chunks with different fonts: Chunk c = new Chunk("Some text in Verdana \n",Ĭhunk c2 = new Chunk("More text in Tahoma",Īnd then create a paragraph and add those chunks: Paragraph p = new Paragraph( ) Chunks and phrases can be added to paragraphs or added directly to documents. A phrase is a collection of chunks that includes a leading separator (the amount of vertical space between lines). A chunk is simply any piece of text with a consistent style using it, you can specify independent fonts and colors. In the previous example, we used a paragraph to add text to the document, but you can also use phrases and chunks to create the text you want. iTextSharp offers a wide range of features to create more complex PDFs. Of course, your requirements will rarely be so simple.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |