public abstract class PDVariableText extends PDTerminalField
| Modifier and Type | Field and Description |
|---|---|
static int |
QUADDING_CENTERED |
static int |
QUADDING_LEFT |
static int |
QUADDING_RIGHT |
| Modifier and Type | Method and Description |
|---|---|
PDFont |
getAppearanceFont() |
PDFont |
getAppearanceOverrideFont() |
String |
getDefaultAppearance()
Get the default appearance.
|
String |
getDefaultStyleString()
Get the default style string.
|
int |
getQ()
This will get the 'quadding' or justification of the text to be displayed.
|
String |
getRichTextValue()
Get the fields rich text value.
|
protected String |
getStringOrStream(COSBase base)
Get a text as text stream.
|
void |
setAppearanceOverrideFont(PDFont appearanceOverrideFont) |
void |
setDefaultAppearance(String daValue)
Set the default appearance.
|
void |
setDefaultStyleString(String defaultStyleString)
Set the default style string.
|
void |
setQ(int q)
This will set the quadding/justification of the text.
|
void |
setRichTextValue(String richTextValue)
Set the fields rich text value.
|
addWidgetIfMissing, applyChange, getFieldFlags, getFieldType, getWidgets, isTerminal, setActions, setWidgetsgetAcroForm, getActions, getAlternateFieldName, getFullyQualifiedName, getInheritableAttribute, getMappingName, getParent, getPartialName, getValueAsString, isNoExport, isReadonly, isRequired, setAlternateFieldName, setFieldFlags, setMappingName, setNoExport, setPartialName, setReadonly, setRequired, setValue, toStringequals, getCOSObject, hashCodepublic static final int QUADDING_LEFT
public static final int QUADDING_CENTERED
public static final int QUADDING_RIGHT
public String getDefaultAppearance()
public void setDefaultAppearance(String daValue)
This method can also be used to change the font of a field, by replacing the font name from this string with
another font name found in the AcroForm default resources before calling
setValue(String), see also
this
stackoverflow answer. For example, "/Helv 10 Tf 0 g" can be replaced with "/F1 10 Tf 0 g". Performance may go
down (see PDFBOX-4508) if this is done for many
fields and with a very large font (e.g. ArialUni); to avoid this, save and reload the file after changing all
fields.
daValue - a string describing the default appearancepublic String getDefaultStyleString()
public void setDefaultStyleString(String defaultStyleString)
defaultStyleString - a string describing the default style.public int getQ()
public void setQ(int q)
q - The new text justification.public String getRichTextValue()
public void setRichTextValue(String richTextValue)
Setting the rich text value will not generate the appearance for the field.
You can set PDAcroForm.setNeedAppearances(Boolean) to signal a conforming reader to generate the
appearance stream.
richTextValue - a rich text stringprotected final String getStringOrStream(COSBase base)
base - the potential text or text streampublic PDFont getAppearanceFont()
public PDFont getAppearanceOverrideFont()
public void setAppearanceOverrideFont(PDFont appearanceOverrideFont)
Copyright © 2020 sejda. All rights reserved.