Class CJKConverter
java.lang.Object
org.apache.pdfbox.encoding.conversion.CJKConverter
- All Implemented Interfaces:
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
ConstructorsConstructorDescriptionCJKConverter
(String encoding) Constructs a CJKConverter from a PDF encoding name. -
Method Summary
Modifier and TypeMethodDescriptionconvertBytes
(byte[] c, int offset, int length, CMap cmap) Convert bytes to a string.Convert a string.
-
Constructor Details
-
CJKConverter
Constructs a CJKConverter from a PDF encoding name.- Parameters:
encoding
- the encoding to be used
-
-
Method Details
-
convertString
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
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
-