Package org.apache.pdfbox.pdmodel.font
Class ToUnicodeWriter
- java.lang.Object
-
- org.apache.pdfbox.pdmodel.font.ToUnicodeWriter
-
final class ToUnicodeWriter extends java.lang.ObjectWrites ToUnicode Mapping Files.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<java.lang.Integer,java.lang.String>cidToUnicode(package private) static intMAX_ENTRIES_PER_OPERATORTo test corner case of PDFBOX-4302.private intwMode
-
Constructor Summary
Constructors Constructor Description ToUnicodeWriter()Creates a new ToUnicode CMap writer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(int cid, java.lang.String text)Adds the given CID to Unicode mapping.(package private) static booleanallowCIDToUnicodeRange(java.util.Map.Entry<java.lang.Integer,java.lang.String> prev, java.util.Map.Entry<java.lang.Integer,java.lang.String> next)(package private) static booleanallowCodeRange(int prev, int next)(package private) static booleanallowDestinationRange(java.lang.String prev, java.lang.String next)voidsetWMode(int wMode)Sets the WMode (writing mode) of this CMap.private voidwriteLine(java.io.BufferedWriter writer, java.lang.String text)voidwriteTo(java.io.OutputStream out)Writes the CMap as ASCII to the given output stream.
-
-
-
Field Detail
-
cidToUnicode
private final java.util.Map<java.lang.Integer,java.lang.String> cidToUnicode
-
wMode
private int wMode
-
MAX_ENTRIES_PER_OPERATOR
static final int MAX_ENTRIES_PER_OPERATOR
To test corner case of PDFBOX-4302.- See Also:
- Constant Field Values
-
-
Method Detail
-
setWMode
public void setWMode(int wMode)
Sets the WMode (writing mode) of this CMap.- Parameters:
wMode- 1 for vertical, 0 for horizontal (default)
-
add
public void add(int cid, java.lang.String text)Adds the given CID to Unicode mapping.- Parameters:
cid- CIDtext- Unicode text, up to 512 bytes.
-
writeTo
public void writeTo(java.io.OutputStream out) throws java.io.IOExceptionWrites the CMap as ASCII to the given output stream.- Parameters:
out- ASCII output stream- Throws:
java.io.IOException- if the stream could not be written
-
writeLine
private void writeLine(java.io.BufferedWriter writer, java.lang.String text) throws java.io.IOException- Throws:
java.io.IOException
-
allowCIDToUnicodeRange
static boolean allowCIDToUnicodeRange(java.util.Map.Entry<java.lang.Integer,java.lang.String> prev, java.util.Map.Entry<java.lang.Integer,java.lang.String> next)
-
allowCodeRange
static boolean allowCodeRange(int prev, int next)
-
allowDestinationRange
static boolean allowDestinationRange(java.lang.String prev, java.lang.String next)
-
-