Package org.apache.fontbox.cmap
Class CMapParser
java.lang.Object
org.apache.fontbox.cmap.CMapParser
Parses a CMap stream.
- Author:
- Ben Litchfield
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance of CMapParser.CMapParser
(boolean strictMode) Creates a new instance of CMapParser. -
Method Summary
Modifier and TypeMethodDescriptionprotected InputStream
getExternalCMap
(String name) Returns an input stream containing the given "use" CMap.Parse a CMAP file on the file system.parse
(InputStream input) This will parse the stream and create a cmap object.parsePredefined
(String name) Parses a predefined CMap.
-
Constructor Details
-
CMapParser
public CMapParser()Creates a new instance of CMapParser. -
CMapParser
public CMapParser(boolean strictMode) Creates a new instance of CMapParser.- Parameters:
strictMode
- activates the strict mode used for inline CMaps
-
-
Method Details
-
parse
Parse a CMAP file on the file system.- Parameters:
file
- The file to parse.- Returns:
- A parsed CMAP file.
- Throws:
IOException
- If there is an issue while parsing the CMAP.
-
parsePredefined
Parses a predefined CMap.- Parameters:
name
- CMap name.- Returns:
- The parsed predefined CMap as a java object, never null.
- Throws:
IOException
- If the CMap could not be parsed.
-
parse
This will parse the stream and create a cmap object.- Parameters:
input
- The CMAP stream to parse.- Returns:
- The parsed stream as a java object, never null.
- Throws:
IOException
- If there is an error parsing the stream.
-
getExternalCMap
Returns an input stream containing the given "use" CMap.- Parameters:
name
- Name of the given "use" CMap resource.- Throws:
IOException
- if the CMap resource doesn't exist or if there is an error opening its stream.
-