Author: tilman
Date: Sat Sep 17 13:55:15 2016
New Revision: 1761238

URL: http://svn.apache.org/viewvc?rev=1761238&view=rev
Log:
PDFBOX-3502: add character and word spacing

Modified:
    
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/PDAbstractContentStream.java

Modified: 
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/PDAbstractContentStream.java
URL: 
http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/PDAbstractContentStream.java?rev=1761238&r1=1761237&r2=1761238&view=diff
==============================================================================
--- 
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/PDAbstractContentStream.java
 (original)
+++ 
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/PDAbstractContentStream.java
 Sat Sep 17 13:55:15 2016
@@ -1512,4 +1512,30 @@ public abstract class PDAbstractContentS
             nonStrokingColorSpaceStack.setElementAt(colorSpace, 
nonStrokingColorSpaceStack.size() - 1);
         }
     }
+
+    /**
+     * Set the character spacing. The value shall be added to the horizontal 
or vertical component
+     * of the glyph's displacement, depending on the writing mode.
+     *
+     * @param spacing character spacing
+     * @throws IOException If the content stream could not be written.
+     */
+    public void setCharacterSpacing(float spacing) throws IOException
+    {
+        writeOperand(spacing);
+        writeOperator("Tc");
+    }
+
+    /**
+     * Set the word spacing. The value shall be added to the horizontal or 
vertical component of the
+     * ASCII SPACE character, depending on the writing mode.
+     *
+     * @param spacing word spacing
+     * @throws IOException If the content stream could not be written.
+     */
+    public void setWordSpacing(float spacing) throws IOException
+    {
+        writeOperand(spacing);
+        writeOperator("Tw");
+    }
 }


Reply via email to