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() |
PDRectangle |
getMediaBox()
Sets page size of produced PDF.
|
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.
|
void |
setMediaBox(PDRectangle mediaBox)
Sets page size of produced PDF.
|
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 document.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 PDRectangle getMediaBox()
public void setMediaBox(PDRectangle mediaBox)
mediaBox
- public boolean isLandscape()
public void setLandscape(boolean landscape)
landscape
- Copyright © 2002–2018 The Apache Software Foundation. All rights reserved.