PDF Clown
0.0.8

it.stefanochizzolini.clown.documents.contents.objects
Class ShowText

java.lang.Object
  extended by it.stefanochizzolini.clown.documents.contents.objects.ContentObject
      extended by it.stefanochizzolini.clown.documents.contents.objects.Operation
          extended by it.stefanochizzolini.clown.documents.contents.objects.ShowText
Direct Known Subclasses:
ShowAdjustedText, ShowSimpleText, ShowTextToNextLine

public abstract class ShowText
extends Operation

Abstract 'show a text string' operation [PDF:1.6:5.3.2].

Since:
0.0.8
Version:
0.0.8
Author:
Stefano Chizzolini (http://www.stefanochizzolini.it)

Nested Class Summary
static interface ShowText.IScanner
           
 
Field Summary
 
Fields inherited from class it.stefanochizzolini.clown.documents.contents.objects.Operation
operands, operator
 
Constructor Summary
protected ShowText(String operator)
           
protected ShowText(String operator, List<PdfDirectObject> operands)
           
protected ShowText(String operator, PdfDirectObject... operands)
           
 
Method Summary
 void applyTo(ContentScanner.GraphicsState state)
          Applies the object's state to the specified graphics state.
abstract  byte[] getText()
          Gets the encoded text.
 List<Object> getValue()
          Gets the encoded text elements along with their adjustments.
 void scan(ContentScanner.GraphicsState state, ShowText.IScanner textScanner)
          Executes scanning on this operation.
abstract  void setText(byte[] value)
           
 void setValue(List<Object> value)
           
 
Methods inherited from class it.stefanochizzolini.clown.documents.contents.objects.Operation
get, getOperands, getOperator, toString, writeTo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ShowText

protected ShowText(String operator)

ShowText

protected ShowText(String operator,
                   PdfDirectObject... operands)

ShowText

protected ShowText(String operator,
                   List<PdfDirectObject> operands)
Method Detail

applyTo

public void applyTo(ContentScanner.GraphicsState state)
Description copied from class: ContentObject
Applies the object's state to the specified graphics state.

Overrides:
applyTo in class ContentObject
Parameters:
state - Content scanner graphics state.

getText

public abstract byte[] getText()
Gets the encoded text.

Remarks

Text is expressed in native encoding: to resolve it to Unicode, pass it to the decode method of the corresponding font.


getValue

public List<Object> getValue()
Gets the encoded text elements along with their adjustments.

Remarks

Text is expressed in native encoding: to resolve it to Unicode, pass it to the decode method of the corresponding font.

Returns:
Each element can be either a byte array or a number: if it's a byte array (encoded text), the operator shows text glyphs; if it's a number (glyph adjustment), the operator inversely adjusts the next glyph position by that amount (that is: a positive value reduces the distance between consecutive glyphs).

scan

public void scan(ContentScanner.GraphicsState state,
                 ShowText.IScanner textScanner)
Executes scanning on this operation.

Parameters:
state - Graphics state context.
textScanner - Scanner to be notified about text contents. In case it's null, the operation is applied to the graphics state context.

setText

public abstract void setText(byte[] value)
See Also:
getText()

setValue

public void setValue(List<Object> value)
See Also:
getValue()

PDF Clown
0.0.8

Project home page

Copyright © 2006-2010 Stefano Chizzolini. Some Rights Reserved.
This documentation is available under the terms of the GNU Free Documentation License.