public final class PdfUtil extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
NEW_LINE_REGEX |
| Constructor and Description |
|---|
PdfUtil() |
| Modifier and Type | Method and Description |
|---|---|
static float |
getFontHeight(org.apache.pdfbox.pdmodel.font.PDFont font,
int fontSize)
Computes the height of a font.
|
static List<String> |
getOptimalTextBreakLines(String text,
org.apache.pdfbox.pdmodel.font.PDFont font,
int fontSize,
float maxWidth)
Split a text into multiple lines to prevent a text-overflow.
|
static float |
getStringWidth(String text,
org.apache.pdfbox.pdmodel.font.PDFont font,
int fontSize)
Computes the width of a String (in points).
|
public static final String NEW_LINE_REGEX
public static float getStringWidth(String text, org.apache.pdfbox.pdmodel.font.PDFont font, int fontSize)
text - Textfont - Font of TextfontSize - FontSize of Stringpublic static float getFontHeight(org.apache.pdfbox.pdmodel.font.PDFont font,
int fontSize)
font - FontfontSize - FontSizepublic static List<String> getOptimalTextBreakLines(String text, org.apache.pdfbox.pdmodel.font.PDFont font, int fontSize, float maxWidth)
text - Textfont - Used fontfontSize - Used fontSizemaxWidth - Maximal width of resulting text-linesCopyright © 2022. All rights reserved.