Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 8553A200B83 for ; Sat, 17 Sep 2016 15:55:20 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 83F0A160ACD; Sat, 17 Sep 2016 13:55:20 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id BF899160ABB for ; Sat, 17 Sep 2016 15:55:19 +0200 (CEST) Received: (qmail 24907 invoked by uid 500); 17 Sep 2016 13:55:18 -0000 Mailing-List: contact commits-help@pdfbox.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@pdfbox.apache.org Delivered-To: mailing list commits@pdfbox.apache.org Received: (qmail 24898 invoked by uid 99); 17 Sep 2016 13:55:18 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 17 Sep 2016 13:55:18 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 8BF4F1805B4 for ; Sat, 17 Sep 2016 13:55:18 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.426 X-Spam-Level: X-Spam-Status: No, score=-0.426 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, RP_MATCHES_RCVD=-1.426] autolearn=disabled Received: from mx2-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id zKCPJHzmmt3W for ; Sat, 17 Sep 2016 13:55:17 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx2-lw-eu.apache.org (ASF Mail Server at mx2-lw-eu.apache.org) with ESMTP id 543DC5F22E for ; Sat, 17 Sep 2016 13:55:17 +0000 (UTC) Received: from svn01-us-west.apache.org (svn.apache.org [10.41.0.6]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 53A37E02E6 for ; Sat, 17 Sep 2016 13:55:16 +0000 (UTC) Received: from svn01-us-west.apache.org (localhost [127.0.0.1]) by svn01-us-west.apache.org (ASF Mail Server at svn01-us-west.apache.org) with ESMTP id BE5553A0248 for ; Sat, 17 Sep 2016 13:55:15 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1761238 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/PDAbstractContentStream.java Date: Sat, 17 Sep 2016 13:55:15 -0000 To: commits@pdfbox.apache.org From: tilman@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20160917135515.BE5553A0248@svn01-us-west.apache.org> archived-at: Sat, 17 Sep 2016 13:55:20 -0000 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"); + } }