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.
|
PDFont |
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(PDFont 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
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 PDFont getFont()
public void setFont(PDFont 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.