Class CJKConverter
- java.lang.Object
-
- org.apache.pdfbox.encoding.conversion.CJKConverter
-
- All Implemented Interfaces:
EncodingConverter
public class CJKConverter extends java.lang.Object implements EncodingConverter
CJKConverter converts encodings defined in CJKEncodings.- Version:
- $Revision: 1.0 $
- Author:
- Pin Xue (http://www.pinxue.net), Holly Lee (holly.lee (at) gmail.com)
-
-
Constructor Summary
Constructors Constructor Description CJKConverter(java.lang.String encoding)
Constructs a CJKConverter from a PDF encoding name.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
convertBytes(byte[] c, int offset, int length, org.apache.fontbox.cmap.CMap cmap)
Convert bytes to a string.java.lang.String
convertString(java.lang.String s)
Convert a string.
-
-
-
Method Detail
-
convertString
public java.lang.String convertString(java.lang.String s)
Convert a string. It occurs when a cmap lookup returned converted bytes successfully, but we still need to convert its encoding. The parameter s is constructs as one byte or a UTF-16BE encoded string. Note: pdfbox set string to UTF-16BE charset before calling into this. Convert a string.- Specified by:
convertString
in interfaceEncodingConverter
- Parameters:
s
- the string to be converted- Returns:
- the converted string
-
convertBytes
public java.lang.String convertBytes(byte[] c, int offset, int length, org.apache.fontbox.cmap.CMap cmap)
Convert bytes to a string. We just convert bytes within coderange defined in CMap. Convert bytes to a string.- Specified by:
convertBytes
in interfaceEncodingConverter
- Parameters:
c
- the byte array to be convertedoffset
- the starting offset of the arraylength
- the number of bytescmap
- the cmap to be used for conversion- Returns:
- the converted string
-
-