Author: tilman Date: Sat Sep 17 13:56:04 2016 New Revision: 1761239 URL: http://svn.apache.org/viewvc?rev=1761239&view=rev Log: PDFBOX-3502: add character and word spacing
Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDPageContentStream.java Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDPageContentStream.java URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDPageContentStream.java?rev=1761239&r1=1761238&r2=1761239&view=diff ============================================================================== --- pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDPageContentStream.java (original) +++ pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDPageContentStream.java Sat Sep 17 13:56:04 2016 @@ -2359,4 +2359,30 @@ public final class PDPageContentStream i writeOperand(rm.intValue()); writeOperator("Tr"); } + + /** + * 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"); + } }