You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by ti...@apache.org on 2018/05/26 02:15:44 UTC
svn commit: r1832289 -
/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAnnotationFreeText.java
Author: tilman
Date: Sat May 26 02:15:43 2018
New Revision: 1832289
URL: http://svn.apache.org/viewvc?rev=1832289&view=rev
Log:
PDFBOX-3353: support /RD and /BE
Modified:
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAnnotationFreeText.java
Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAnnotationFreeText.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAnnotationFreeText.java?rev=1832289&r1=1832288&r2=1832289&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAnnotationFreeText.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAnnotationFreeText.java Sat May 26 02:15:43 2018
@@ -20,6 +20,7 @@ import org.apache.pdfbox.cos.COSBase;
import org.apache.pdfbox.cos.COSDictionary;
import org.apache.pdfbox.cos.COSFloat;
import org.apache.pdfbox.cos.COSName;
+import org.apache.pdfbox.pdmodel.common.PDRectangle;
import org.apache.pdfbox.pdmodel.interactive.annotation.handlers.PDAppearanceHandler;
import org.apache.pdfbox.pdmodel.interactive.annotation.handlers.PDFreeTextAppearanceHandler;
import org.apache.pdfbox.pdmodel.interactive.form.PDVariableText;
@@ -225,6 +226,64 @@ public class PDAnnotationFreeText extend
}
/**
+ * This will set the border effect dictionary, specifying effects to be applied when drawing the
+ * line.
+ *
+ * @param be The border effect dictionary to set.
+ *
+ */
+ public void setBorderEffect(PDBorderEffectDictionary be)
+ {
+ getCOSObject().setItem(COSName.BE, be);
+ }
+
+ /**
+ * This will retrieve the border effect dictionary, specifying effects to be applied used in
+ * drawing the line.
+ *
+ * @return The border effect dictionary
+ */
+ public PDBorderEffectDictionary getBorderEffect()
+ {
+ COSBase base = getCOSObject().getDictionaryObject(COSName.BE);
+ if (base instanceof COSDictionary)
+ {
+ return new PDBorderEffectDictionary((COSDictionary) base);
+ }
+ return null;
+ }
+
+ /**
+ * This will set the rectangle difference rectangle. Giving the difference between the
+ * annotations rectangle and where the drawing occurs. (To take account of any effects applied
+ * through the BE entry for example)
+ *
+ * @param rd the rectangle difference
+ *
+ */
+ public void setRectDifference(PDRectangle rd)
+ {
+ getCOSObject().setItem(COSName.RD, rd);
+ }
+
+ /**
+ * This will get the rectangle difference rectangle. Giving the difference between the
+ * annotations rectangle and where the drawing occurs. (To take account of any effects applied
+ * through the BE entry for example)
+ *
+ * @return the rectangle difference
+ */
+ public PDRectangle getRectDifference()
+ {
+ COSBase base = getCOSObject().getDictionaryObject(COSName.RD);
+ if (base instanceof COSArray)
+ {
+ return new PDRectangle((COSArray) base);
+ }
+ return null;
+ }
+
+ /**
* Set a custom appearance handler for generating the annotations appearance streams.
*
* @param appearanceHandler