public class TextToPDF extends Object
| Constructor and Description |
|---|
TextToPDF() |
| Modifier and Type | Method and Description |
|---|---|
void |
createPDFFromText(org.apache.pdfbox.pdmodel.PDDocument doc,
Reader text)
Create a PDF document with some text.
|
org.apache.pdfbox.pdmodel.PDDocument |
createPDFFromText(Reader text)
Create a PDF document with some text.
|
org.apache.pdfbox.pdmodel.font.PDFont |
getFont() |
int |
getFontSize() |
org.apache.pdfbox.pdmodel.common.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(org.apache.pdfbox.pdmodel.font.PDFont aFont) |
void |
setFontSize(int aFontSize) |
void |
setLandscape(boolean landscape)
Sets paper orientation.
|
void |
setMediaBox(org.apache.pdfbox.pdmodel.common.PDRectangle mediaBox)
Sets page size of produced PDF.
|
public org.apache.pdfbox.pdmodel.PDDocument createPDFFromText(Reader text) throws IOException
text - The stream of text data.IOException - If there is an error writing the data.public void createPDFFromText(org.apache.pdfbox.pdmodel.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 org.apache.pdfbox.pdmodel.font.PDFont getFont()
public void setFont(org.apache.pdfbox.pdmodel.font.PDFont aFont)
aFont - The font to set.public int getFontSize()
public void setFontSize(int aFontSize)
aFontSize - The fontSize to set.public org.apache.pdfbox.pdmodel.common.PDRectangle getMediaBox()
public void setMediaBox(org.apache.pdfbox.pdmodel.common.PDRectangle mediaBox)
mediaBox - public boolean isLandscape()
public void setLandscape(boolean landscape)
landscape - Copyright © 2002–2020 The Apache Software Foundation. All rights reserved.