public class TextToPDF extends Object
Constructor and Description |
---|
TextToPDF() |
Modifier and Type | Method and Description |
---|---|
void |
createPDFFromText(PDDocument doc,
Reader text)
Create a PDF document with some text.
|
PDDocument |
createPDFFromText(Reader text)
Create a PDF document with some text.
|
PDSimpleFont |
getFont() |
int |
getFontSize() |
boolean |
isLandscape()
Tells the paper orientation.
|
static void |
main(String[] args)
This will create a PDF document with some text in it.
|
void |
setFont(PDSimpleFont aFont) |
void |
setFontSize(int aFontSize) |
void |
setLandscape(boolean landscape)
Sets paper orientation.
|
public PDDocument createPDFFromText(Reader text) throws IOException
text
- The stream of text data.IOException
- If there is an error writing the data.public void createPDFFromText(PDDocument doc, Reader text) throws IOException
doc
- The PDF document that shall content the text.text
- The stream of text data.IOException
- If there is an error writing the data.public static void main(String[] args) throws IOException
args
- Command line arguments.IOException
- If there is an error with the PDF.public PDSimpleFont getFont()
public void setFont(PDSimpleFont aFont)
aFont
- The font to set.public int getFontSize()
public void setFontSize(int aFontSize)
aFontSize
- The fontSize to set.public boolean isLandscape()
public void setLandscape(boolean landscape)
landscape
- Copyright © 2002–2017 The Apache Software Foundation. All rights reserved.