org.foray.pdf.object
Class PDFCMap

java.lang.Object
  extended by org.foray.pdf.object.PDFObject
      extended by org.foray.pdf.object.PDFStream
          extended by org.foray.pdf.object.PDFCMap
Direct Known Subclasses:
PDFToUnicodeCMap

public class PDFCMap
extends PDFStream

A CMap encoding.

See Also:
"PDF Reference, 3rd Edition, Section 5.6.4."

Nested Class Summary
static class PDFCMap.Type
          Enumeration of the predefined CMap encodings in PDF.
 
Field Summary
static byte WMODE_HORIZONTAL
          Constant indicating the horizontal writing direction.
static byte WMODE_VERTICAL
          Constant indicating the vertical writing direction.
 
Fields inherited from class org.foray.pdf.object.PDFObject
EOL, MSG_EOL, XREF_EOL
 
Constructor Summary
PDFCMap(PDFDocument doc, PDFCMap.Type name)
          Create the /CMap object.
 
Method Summary
protected  void finalizeStreamContent()
          This method is an explicit opportunity for subclasses to finish writing whatever content may still need to be written to the stream before the dictionary and stream contents are written.
protected  String specialStreamDictEntries()
          Subclasses return any specialized dictionary entries here, so that they are included when writing the stream dictionary.
protected  void writeBFEntries(StringBuilder p)
          Writes the BF entries portion of the CMAP content.
protected  void writeCIDInit(StringBuilder p)
          Writes the CID init portion of the CMAP content.
protected  void writeCIDRange(StringBuilder p)
          Writes the CID range portion of the CMAP content.
protected  void writeCIDSystemInfo(StringBuilder p)
          Writes the CID Sytem Info portion of the CMAP content.
protected  void writeCodeSpaceRange(StringBuilder p)
          Writes the space range portion of the CMAP content.
protected  void writePreStream(StringBuilder p)
          Writes the pre-stream portion of the CMAP content.
protected  void writeStreamAfterComments(StringBuilder p)
          Writes the after-stream portion of the CMAP content.
protected  void writeStreamComments(StringBuilder p)
          Writes the stream comments of the CMAP content.
protected  void writeUseCMap(StringBuilder p)
          Writes the use CMAP portion of the CMAP content.
protected  void writeVersionTypeName(StringBuilder p)
          Writes the version, type, and name portion of the CMAP content.
protected  void writeWrapUp(StringBuilder p)
          Writes the wrap-up portion of the CMAP content.
 
Methods inherited from class org.foray.pdf.object.PDFStream
add, addDefaultFilters, addEncryption, addFilter, addFilter, applyFilters, getDataLength, getOutputStream, output, outputStreamData, setData, setOutputStream, toPDF
 
Methods inherited from class org.foray.pdf.object.PDFObject
bufferToByteArray, byteArrayToStream, getCharsPerLine, getGeneration, getLogger, getNumber, getPDFDocument, pdfID, pdfReference, setNumber, stringToByteArray
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WMODE_HORIZONTAL

public static final byte WMODE_HORIZONTAL
Constant indicating the horizontal writing direction.

See Also:
Constant Field Values

WMODE_VERTICAL

public static final byte WMODE_VERTICAL
Constant indicating the vertical writing direction.

See Also:
Constant Field Values
Constructor Detail

PDFCMap

public PDFCMap(PDFDocument doc,
               PDFCMap.Type name)
Create the /CMap object.

Parameters:
doc - The parent PDF document.
name - One of the predefined CMAP types.
Method Detail

writePreStream

protected void writePreStream(StringBuilder p)
Writes the pre-stream portion of the CMAP content.

Parameters:
p - The buffer into which the content should be written.

writeStreamComments

protected void writeStreamComments(StringBuilder p)
Writes the stream comments of the CMAP content.

Parameters:
p - The buffer into which the content should be written.

writeCIDInit

protected void writeCIDInit(StringBuilder p)
Writes the CID init portion of the CMAP content.

Parameters:
p - The buffer into which the content should be written.

writeCIDSystemInfo

protected void writeCIDSystemInfo(StringBuilder p)
Writes the CID Sytem Info portion of the CMAP content.

Parameters:
p - The buffer into which the content should be written.

writeVersionTypeName

protected void writeVersionTypeName(StringBuilder p)
Writes the version, type, and name portion of the CMAP content.

Parameters:
p - The buffer into which the content should be written.

writeCodeSpaceRange

protected void writeCodeSpaceRange(StringBuilder p)
Writes the space range portion of the CMAP content.

Parameters:
p - The buffer into which the content should be written.

writeCIDRange

protected void writeCIDRange(StringBuilder p)
Writes the CID range portion of the CMAP content.

Parameters:
p - The buffer into which the content should be written.

writeBFEntries

protected void writeBFEntries(StringBuilder p)
Writes the BF entries portion of the CMAP content.

Parameters:
p - The buffer into which the content should be written.

writeWrapUp

protected void writeWrapUp(StringBuilder p)
Writes the wrap-up portion of the CMAP content.

Parameters:
p - The buffer into which the content should be written.

writeStreamAfterComments

protected void writeStreamAfterComments(StringBuilder p)
Writes the after-stream portion of the CMAP content.

Parameters:
p - The buffer into which the content should be written.

writeUseCMap

protected void writeUseCMap(StringBuilder p)
Writes the use CMAP portion of the CMAP content.

Parameters:
p - The buffer into which the content should be written.

finalizeStreamContent

protected void finalizeStreamContent()
                              throws org.axsl.pdf.PdfException
Description copied from class: PDFStream
This method is an explicit opportunity for subclasses to finish writing whatever content may still need to be written to the stream before the dictionary and stream contents are written.

Specified by:
finalizeStreamContent in class PDFStream
Throws:
org.axsl.pdf.PdfException - For errors writing stream content.

specialStreamDictEntries

protected String specialStreamDictEntries()
Description copied from class: PDFStream
Subclasses return any specialized dictionary entries here, so that they are included when writing the stream dictionary.

Specified by:
specialStreamDictEntries in class PDFStream
Returns:
Any specialized dictionary entries.


Copyright © 2017. All rights reserved.