PDFBox Working with FontsIn PDFBox, there might be a need to add text with different font family and size. The PDFBox specification states that "The standard set of 14 fonts will always be available in working with PDF documents". In PDFBox, these set of 14 fonts are defined as constants in the PDType1Font class. A Font is loaded from a file by using PDType1Font API. PDFBox supports the following fonts-
We can configured font for text by using setFont API available on Content Stream. ExampleThis example creates a new document and prints the text "Hello World!!!" using one of the PDF base Font. Output: After successful execution of the above program, open the PDF Document which shows the following output.
Next TopicPDFBox Working with Attachments
|