#define PDFONTFLAGS_USEDBYFORM
0x00000001
#define PDLastOneByteEncoding
PDLastKnownEncoding
#define PDUnicodeEncoding
PDLastKnownEncoding
#define PD_ALL_CAP
0x00010000
#define PD_FIXED_WIDTH
0x00000001
#define PD_FORCE_BOLD
0x00040000
#define PD_ITALIC
0x00000040
#define PD_PI
0x00000004
#define PD_SCRIPT
0x00000008
#define PD_SEGASCII
(
(
ASUns8
)
1
)
#define PD_SEGBINARY
(
(
ASUns8
)
2
)
#define PD_SEGEOF
(
(
ASUns8
)
3
)
#define PD_SERIF
0x00000002
#define PD_SMALL_CAP
0x00020000
#define PD_STD_ENCODING
0x00000020
#define PSNAMESIZE
128
An enumerated data type that specifies a font's encoding. To learn more about MacRoman Encoding, see:
You can find this document on the web store of the International Standards Organization (ISO).
PDBuiltInEncoding = - 1 | The encoding specified internally in the font. In the case of a Type 1 or MMType 1 font, this is specified by the Encoding value in the font's
fontdict . In the case of TrueType fonts, this is the encoding specified by the default one-byte CMap for the platform. |
PDMacRomanEncoding = 0 | MacRomanEncoding, see Annex D, "Character Sets and Encodings, in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, page 651.
|
PDMacExpertEncoding = 1 | MacExpertEncoding, see Annex D, "Character Sets and Encodings," page 651.
|
PDWinAnsiEncoding = 2 | WinAnsiEncoding, see Annex D, "Character Sets and Encodings," page 651.
|
PDStdEncoding = 3 | StandardEncoding, see Annex D, "Character Sets and Encodings," page 651.
|
PDFDocEncoding = 4 | PDFDocEncoding, see Annex D, "Character Sets and Encodings," page 651. This will never be returned for a font; it is used internally.
|
PDLastKnownEncoding |
typedef
struct
_t_PDCharProc
*
PDCharProc
;
For value options see PDCharSets.
typedef
ASEnum8
PDCharSet
;
typedef
struct
_t_PDFont
*
PDFont
;
typedef
ASInt16
PDFontAngle
;
An enumerated data type that specifies a font's encoding. To learn more about MacRoman Encoding, see:
You can find this document on the web store of the International Standards Organization (ISO).
typedef
ASEnum8
PDFontEncoding
;
typedef
ASUns16
PDFontMetric
;
typedef
ASInt16
PDFontOffset
;
typedef
ASInt16
PDiFontMetric
;
ASBool
PDCharProcEnumProc(
char
*
name
,
PDCharProc
obj
,
void
*
clientData
);
name | IN/OUT The name of the current character.
|
obj | IN/OUT A stream Cos object containing the PDF drawing operators that draw the character.
|
clientData | IN/OUT User-supplied data that was passed in the call to PDFontEnumCharProcs().
|
ASBool
PDFontEnumProc(
PDFont
font
,
PDFontFlags
*
fontFlags
,
void
*
clientData
);
font | The font currently being enumerated.
|
fontFlags | PDFontFlags used when PDDocEnumFonts() was called.
|
clientData | User-supplied data passed in the call to PDDocEnumFonts() or PDDocEnumLoadedFonts().
|
| |
Not used. For backward compatibility.
| |
It must be an OR of the
PDFONTFLAGS_ values. All unused flags must be off. | |
|
A data structure containing information about a font's metrics. For more information about font metrics see the description of Font Descriptors in the ISO 32000-1:2008, Document Management- Portable Document Format-Part 1: PDF 1.7, section 9.8, page 281.
You can find this document on the web store of the International Standards Organization (ISO).
You also can find information about Adobe Font Metrics (AFM) at https://www.adobe.com/devnet/font.html
| |
It must be an OR of the Font Flags values. All unused flags must be off.
| |
A font bounding box in 1000 EM units. An EM is a typographic unit of measurement equal to the size of a font. In a 12-point font, an EM is 12 points.
| |
The width of the missing character (
.notdef ) | |
The vertical stem width.
| |
The horizontal stem width.
| |
The capital height.
| |
The X height.
| |
The maximum ascender height.
| |
The maximum descender depth.
| |
The additional leading between lines.
| |
The maximum character width.
| |
The average character width.
| |
The italic angle in degrees, if any.
| |
The PANOSE and sFamily class values.
| |
The baseline adjustment, which is a vertical adjustment for font baseline difference and writing mode 1 (vertical). This should only be used for CIDFontType 2 fonts with font substitution.
| |
|
A data structure containing PANOSE and sFamily class values for a font. It is used in the PDFontMetrics structure. See the description of Panose in "Font Descriptors for CIDFonts" ISO 32000-1:2008, Document Management- Portable Document Format-Part 1: PDF 1.7, section 9.8.3, page 285.
You can find this document on the web store of the International Standards Organization (ISO).
| |
A number that identifies the font family and determines the meaning of the remaining PANOSE digits. The possible families are Latin, Kanji, Hebrew, and so forth.
| |
A number to identify the kind of family: text, decorative, handwritten, symbols, and so on.
| |
A number to identify the family type: text, decorative, handwritten, symbols, and so on.
| |
A number that specifies the font's serif style, such as cove, obtuse cove, square, bone, and so forth.
| |
A number that specifies the font's weight, such as very light, heavy, black, and so on.
| |
A number that specifies the font's proportions, such as modern, expanded, condensed, mono-spaced, and so on.
| |
|
void
PDCharProcEnumWithParams(
PDCharProc
obj
,
PDGraphicEnumParams
params
);
obj | The character procedure whose graphic descriptions are enumerated.
|
params | The parameters, including the optional-content context to use for content visibility.
|
Acquires a font's encoding array (the mapping of character codes to glyphs). When you are done with this array, call PDFontEncodingArrayRelease() to release it.
The array contains 256 pointers. If a pointer is not NULL
, it points to a C string containing the name of the glyph for the code point corresponding to the index. If it is NULL
, then the name of the glyph is unchanged from that specified by the font's built-in encoding.
For a Type 3 font, all glyph names will be present in the encoding array, and NULL
entries correspond to un-encoded code points.
For non-Roman character set viewers, it is not appropriate to call this method.
ASUns8
*
*
PDFontAcquireEncodingArray(
PDFont
font
);
font | The font whose encoding array is obtained.
|
NULL
if there is no encoding array associated with the font. This function fills in the base encoding, differences, and standard encoding for a font. Acquires a font's encoding array (the mapping of character codes to glyphs). When you are done with this array, call PDFontEncodingArrayRelease() to release it.
The array contains 256 pointers. If a pointer is not NULL
, it points to a C string containing the name of the glyph for the code point corresponding to the index. If it is NULL
, then the name of the glyph is unchanged from that specified by the font's built-in encoding.
For a Type 3 font, all glyph names will be present in the encoding array, and NULL
entries correspond to un-encoded code points.
For non-Roman character set viewers, it is not appropriate to call this method.
ASUns8
*
*
PDFontAcquireEncodingArrayFull(
PDFont
font
);
font | The font whose encoding array is obtained.
|
NULL
if there is no encoding array associated with the font. Increments the specified font's XlateTable reference count and also returns the XlateTable, which is a 256-entry table that maps characters from their encoding in the PDF file to host encoding. If a character cannot be mapped to host encoding, then the table entry will (for that character) contain-1
. When you are done using the XlateTable, call PDFontXlateTableRelease() to release it.
For non-Roman character set viewers, it is not appropriate to call this method.
ASInt16
*
PDFontAcquireXlateTable(
PDFont
font
);
font | IN/OUT The font whose XlateTable is obtained.
|
NULL
. void
PDFontEncodingArrayRelease(
ASUns8
*
*
array
);
array | IN/OUT The encoding array to release.
|
PDFont
PDFontFromCosObj(
CosObj
fontObj
);
fontObj | IN/OUT The dictionary Cos object for the font.
|
Fills in an ASText object with the font name, to be used in displaying lists or menus.
In PDF 1.5, the font name can be represented with a UTF8 byte sequence. In previous versions of Acrobat the name could also be represented by host encodings such as Shift- JIS, Big5, KSC, and so on. This routine tries to return a text object that uses the correct script, but cannot always do so.
The ASText object is owned by the caller.
void
PDFontGetASTextName(
PDFont
font
,
ASBool
removePrefix
,
ASText
nameToFill
);
font | The font whose name is obtained.
|
removePrefix | Whether to remove the subset prefix, if present. For example, when
true , the name "ABCDEF+Myriad" is returned as "Myriad" . |
nameToFill | (Filled by the method) The ASText object for the font's name.
|
void
PDFontGetBBox(
PDFont
font
,
ASFixedRect
*
bboxP
);
font | IN/OUT The font whose bounding box is obtained.
|
bboxP | IN/OUT (Filled by the method) A pointer to a rectangle specifying the font's bounding box.
|
Gets an ASAtom representing Registry and Ordering for a CIDFont. This information resides in the CIDSystemInfo entry of the CIDFont dictionary, which describes a CIDFont.
PDFontGetCIDSystemInfo() takes either a Type 0 font or a descendant font (CIDType0 or CIDType2) as an argument. This information is always present for any Type 0 font; the actual registry ordering information is a part of the descendant font.
This method provides one way to identify a font's language.
The CIDSystemInfo entry uses three components to identify a character collection uniquely:
The PDFontGetCIDSystemInfo() method obtains the first two of these components.
A CIDFont is designed to contain a large number of glyph procedures. Instead of being accessed by a name, each glyph procedure is accessed by an integer known as a character identifier or CID. Instead of a font encoding, CIDFonts use a CMap with a Type 0 composite font to define the mapping from character codes to a font number and a character selector.
For more information on Type 0 fonts, CIDFonts, and CMaps, See the description of Composite Fonts in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 9.7, page 267.
You can find this document on the web store of the International Standards Organization (ISO).
For detailed information on CIDFonts, see:
Technical Note #5092, CID-Keyed Font Technology Overview
https://www.adobe.com/content/dam/acom/en/devnet/font/pdfs/5092.CID_Overview.pdf
Technical Note #5014, Adobe CMap and CIDFont Files Specification
https://www.adobe.com/content/dam/acom/en/devnet/font/pdfs/5014.CIDFont_Spec.pdf
ASAtom
PDFontGetCIDSystemInfo(
PDFont
font
);
font | IN/OUT The font whose Registry and Ordering information is obtained.
|
"Adobe-Japan1"
). Gets the SystemSupplement number of a CIDFont. This field resides in the CIDSystemInfo entry of the CIDFont dictionary, which describes a CIDFont.
The CIDSystemInfo entry uses three components to identify a character collection uniquely:
PDFontGetCIDSystemInfo() provides character collection information, and PDFontGetCIDSystemSupplement() specifies the version of the ordering.
A CIDFont is designed to contain a large number of glyph procedures. Instead of being accessed by a name, each glyph procedure is accessed by an integer known as a character identifier or CID. Instead of a font encoding, CIDFonts use a CMap with a Type 0 composite font to define the mapping from character codes to a font number and a character selector.
For more information on Type 0 fonts, CIDFonts, and CMaps, see the description of Composite Fonts in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 9.7, page 267.
You can find this document on the web store of the International Standards Organization (ISO).
For detailed information on CIDFonts, see:
Technical Note #5092, CID-Keyed Font Technology Overview
https://www.adobe.com/content/dam/acom/en/devnet/font/pdfs/5092.CID_Overview.pdf
Technical Note #5014, Adobe CMap and CIDFont Files Specification
https://www.adobe.com/content/dam/acom/en/devnet/font/pdfs/5014.CIDFont_Spec.pdf
ASInt32
PDFontGetCIDSystemSupplement(
PDFont
font
);
font | IN/OUT The font whose
SystemSupplement field is obtained. |
SystemSupplement
field from the CIDFont. Gets the font's character set. This is derived from the 'Uses Adobe standard encoding' bit in the font descriptor (if the font has a font descriptor) or from the font's name (if the font is one of the base 14 fonts and does not have a font descriptor).
For non-Roman character set viewers, call PDFontGetEncodingName() instead.
PDCharSet
PDFontGetCharSet(
PDFont
font
);
font | IN/OUT The font whose character set is obtained.
|
CosObj
PDFontGetCosObj(
PDFont
font
);
font | IN/OUT The font whose Cos object is obtained.
|
Gets a Type 0 font's descendant, which may be a CIDType0 or CIDType2 font.
Type 0 fonts support single-byte or multi-byte encodings and can refer to one or more descendant fonts. These fonts are analogous to the Type 0 or composite fonts supported by Level 2 PostScript interpreters. However, PDF Type 0 fonts only support character encodings defined by a CMap. The CMap specifies the mappings between character codes and the glyphs in the descendant fonts.
For information about Type 0 fonts, see the description of Composite Fonts in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 9.7, page 267.
You can find this document on the web store of the International Standards Organization (ISO).
For more information on CMAPS, see page 272 of the same document.
You can find this document on the web store of the International Standards Organization (ISO).
PDFont
PDFontGetDescendant(
PDFont
font
);
font | IN/OUT The font whose descendant is obtained.
|
Gets a font's encoding index.
For non-Roman character set viewers, call PDFontGetEncodingName() instead.
ASInt32
PDFontGetEncodingIndex(
PDFont
font
);
font | IN/OUT The font whose encoding index is obtained.
|
Gets a string representing a font's encoding.
Use PDFontGetEncodingIndex() to get encoding information for Roman viewers.
Host encoding is a platform-dependent encoding for the host machine. For non-UNIX Roman systems, it is WinAnsiEncoding
on Windows and MacRomanEncoding
on Mac OS. On UNIX (except HP-UX) Roman systems, it is ISO8859-1
(ISO Latin-1); for HP-UX, it is HP-ROMAN8
.
For descriptions of WinAnsiEncoding
, MacRomanEncoding
, and PDFDocEncoding
, see Annex D, "Character Sets and Encodings, in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, page 651.
You can find this document on the web store of the International Standards Organization (ISO).
For non-Roman systems, the host encoding may be a variety of encodings, which are defined by a CMap (character map). See a list of predefined CMaps in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 9.7.5, page 272.
You can find this document on the web store of the International Standards Organization (ISO).
In this case, the encoding string contains values such as "90ms-RKSJ-H"
, "90msp-RKSJ-H"
, "Identity-V"
, or "90pv-RKSJ-H"
; it does not return a string like "Shift-JIS"
.
const
ASUns8
*
PDFontGetEncodingName(
PDFont
font
);
font | The font whose encoding name is obtained.
|
Gets a font's metrics, which provide the information needed to create a substitute Multiple Master font when the original font is unavailable. See the description of Font Descriptors in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 9.8, page 281.
You can find this document on the web store of the International Standards Organization (ISO).
void
PDFontGetMetrics(
PDFont
font
,
PDFontMetricsP
metricsP
,
ASSize_t
sizeMetrics
);
font | IN/OUT The font whose metrics are being obtained.
|
metricsP | IN/OUT (Filled by the method) A pointer to a PDFontMetrics structure containing the font's metrics. The font metric values may be patched before being returned. If the actual values in the PDF file are required, use Cos instead to get trustworthy metrics.
|
sizeMetrics | IN/OUT It must be
sizeof(PDFontMetrics) . |
Gets the name of a font. The behavior depends on the font type; for a Type 3 font it gets the value of the Name key in a PDF Font resource. See the description of font types in "Introduction to Font Data Structures" in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 9.5, page 253.
You can find this document on the web store of the International Standards Organization (ISO).
For other types it gets the value of the BaseFont key in a PDF font resource.
ASInt32
PDFontGetName(
PDFont
font
,
char
*
buffer
,
ASInt32
bufSize
);
font | IN/OUT The font whose name is obtained.
|
buffer | |
bufSize | IN/OUT The length of
buffer in bytes. The maximum font name length that the Acrobat viewer will return is PSNAMESIZE (see PDExpT. h). |
buffer
, bufSize
-
1
bytes are copied into buffer
, and buffer
is NULL
-terminated. ASAtom
PDFontGetSubtype(
PDFont
font
);
font | IN/OUT The font whose subtype is obtained.
|
Gets the advance width of every glyph in a font. The advance width is the amount by which the current point advances when the glyph is drawn. The advance width may not correspond to the visible width of the glyph (for example, a glyph representing an accent mark might have an advance width of zero so that characters can be drawn under it). For this reason, the advance width cannot be used to determine the glyphs' bounding boxes.
For non-Roman character set viewers, this method gets the width for a single byte range ( 0
through 255
).
void
PDFontGetWidths(
PDFont
font
,
ASInt16
*
widths
);
font | IN/OUT The font whose glyph advance widths are obtained.
|
widths | IN/OUT (Filled by the method) An array of glyph advance widths, measured in character space units. Un-encoded code points will have a width of zero. For non-Roman character set viewers, an array for a single byte range (
0 through 255 ). |
ASBool
PDFontIsEmbedded(
PDFont
font
);
font | The font to test.
|
Sets a font's metrics, which provide the information needed to create a substitute Multiple Master font when the original font is unavailable. See the description of Font Descriptors in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 9.8, page 281.
You can find this document on the web store of the International Standards Organization (ISO).
This method can only be used on Type 1, Multiple Master Type 1, and TrueType fonts; it cannot be used on Type 3 fonts.
void
PDFontSetMetrics(
PDFont
font
,
PDFontMetricsP
metricsP
,
ASSize_t
sizeMetrics
);
font | IN/OUT The font whose metrics are being set.
|
metricsP | IN/OUT A pointer to a PDFontMetrics structure containing the font's metrics.
|
sizeMetrics | IN/OUT It must be
sizeof(PDFontMetrics) . |
Translates a string from the PDFont's encoding into host encoding. If any characters cannot be represented in host encoding, they are replaced with space characters. If no XlateTable exists in the font, the function returns false
and outP
is not written.
For non-Roman character set viewers, it is not appropriate to call this method. Instead call one of the following: PDFontXlateToHost(), PDFontXlateToUCS(), PDXlateToHostEx(), or PDXlateToPDFDocEncEx().
ASBool
PDFontXlateString(
PDFont
font
,
ASUns8
*
inP
,
ASUns8
*
outP
,
ASInt32
len
);
font | The font (and hence, the encoding) that
inP uses. |
inP | The string to translate.
|
outP | (Filled by the method) The translated string.
outP may point to the same buffer as inP , to allow in-place translation. |
len | The length of
inP and outP . |
-1
. void
PDFontXlateTableRelease(
ASInt16
*
table
);
table | IN/OUT The XlateTable to release.
|
Translates a string from the PDFont's encoding to host encoding. This is useful for converting the text from a PDWord into host encoding. In the same way that PDXlateToHostEx() converts text from bookmark titles to host encoding, PDFontXlateToHost() converts text from a page contents stream to host encoding. Use PDFontXlateToUCS() to translate from the PDFont's encoding to Unicode.
Non-Roman fonts, such as PostScript composite fonts, can be encoded in different ways, such as SHIFT-JIS, RKSJ, and so on. To use PDFontXlateToHost(), the caller does not need to know which encoding he is converting from, since that information is contained in the PDFont.
Host encoding is a platform-dependent encoding for the host machine. For non-UNIX Roman systems, it is WinAnsiEncoding
on Windows and MacRomanEncoding
on Mac OS. On UNIX (except HP-UX) Roman systems, it is ISO8859-1
(ISO Latin-1); for HP-UX, it is HP-ROMAN8
.
For descriptions of WinAnsiEncoding
, MacRomanEncoding
, and PDFDocEncoding
, see Annex D, "Character Sets and Encodings, in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, page 651.
You can find this document on the web store of the International Standards Organization (ISO).
For non-Roman systems, the host encoding may be a variety of encodings, which are defined by a CMap (character map). For a list of predefined CMaps see the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 9.7.5, page 272.
You can find this document on the web store of the International Standards Organization (ISO).
Use PDGetHostEncoding() to determine if a system's host encoding is Roman.
ASInt32
PDFontXlateToHost(
PDFont
fontP
,
ASUns8
*
inP
,
ASInt32
inLen
,
ASUns8
*
outP
,
ASInt32
outLen
);
fontP | The font used in the input string
inP . |
inP | A pointer to the string to translate.
|
inLen | The length of the
inP buffer in bytes. |
outP | (Filled by the method) A pointer to the translated string.
|
outLen | The length of the
outP buffer in bytes. |
outP
. Translates a string from whatever encoding the PDFont uses to Unicode encoding. This is useful for converting the text from a PDWord into Unicode. Use PDFontXlateToHost() to translate from the PDFont's encoding to host encoding.
Non-Roman fonts, like PostScript composite fonts, can be encoded in different ways, such as SHIFT-JIS, RKSJ, and so on. The caller does not need to know which encoding they're converting from, since that information is contained in the PDFont.
Host encoding is a platform-dependent encoding for the host machine. For non-UNIX Roman systems, it is WinAnsiEncoding
on Windows and MacRomanEncoding
on Mac OS. On UNIX (except HP-UX) Roman systems, it is ISO8859-1
(ISO Latin-1); for HP-UX, it is HP-ROMAN8
.
For descriptions of WinAnsiEncoding
, MacRomanEncoding
, and PDFDocEncoding
, see Annex D, "Character Sets and Encodings, in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, page 651.
You can find this document on the web store of the International Standards Organization (ISO).
For non-Roman systems, the host encoding may be a variety of encodings, which are defined by a CMap (character map). For a list of predefined CMaps see the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 9.7.5, page 272.
You can find this document on the web store of the International Standards Organization (ISO).
Use PDGetHostEncoding() to determine if a system's host encoding is Roman.
ASInt32
PDFontXlateToUCS(
PDFont
fontP
,
ASUns8
*
inP
,
ASInt32
inLen
,
ASUns8
*
outP
,
ASInt32
outLen
);
fontP | The font of the input string
inP . |
inP | A pointer to the string to translate.
|
inLen | The length of the
inP buffer in bytes. |
outP | (Filled by the method) A pointer to the translated string. If it is
NULL , the method returns the size of the translated string. |
outLen | The length of the
outP buffer in bytes. If it is 0 , the method returns the size of the translated string. |
outP
. Translates an array of 256 glyph advance widths (obtained from PDFontGetWidths()) from their order in the PDF file into host encoding order. If the widths are already in host encoding order, the widths are merely copied. All un-encoded code points are given a width of zero.
For non-Roman character set viewers, it is not appropriate to call this method.
void
PDFontXlateWidths(
PDFont
font
,
ASInt16
*
inP
,
ASInt16
*
outP
);
font | IN/OUT The font whose glyph widths are translated.
|
inP | IN/OUT The array of glyph advance widths to rearrange.
|
outP | IN/OUT (Filled by the method) The rearranged array of glyph advance widths.
|
Indicates what kind of host encoding a system uses. It allows you to determine whether a system is Roman or non-Roman. (Non-Roman is also known as CJK-capable, which means that it is capable of handling multi-byte character sets such as Chinese, Japanese, or Korean).
Host encoding is a platform-dependent encoding for the host machine. For non-UNIX Roman systems, it is WinAnsiEncoding
on Windows and MacRomanEncoding
on Mac OS. On UNIX (except HP-UX) Roman systems, it is ISO8859-1
(ISO Latin-1); for HP-UX, it is HP-ROMAN8
.
For descriptions of WinAnsiEncoding
, MacRomanEncoding
, and PDFDocEncoding
, see Annex D, "Character Sets and Encodings, in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, page 651.
You can find this document on the web store of the International Standards Organization (ISO).
For non-Roman systems, the host encoding may be a variety of encodings, which are defined by a CMap (character map). For a list of predefined CMaps see the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 9.7.5, page 272.
You can find this document on the web store of the International Standards Organization (ISO).
Use PDGetHostEncoding() to determine if a system's host encoding is Roman.
ASHostEncoding
PDGetHostEncoding(
void
);
0
for a Roman system, nonzero for a non-Roman system (a structure that depends on the host encoding). Users should simply test whether this value is 0
. Gets an array describing the differences between the platform's host encoding and PDFDocEncoding
.
Host encoding is a platform-dependent encoding for the host machine. For non-UNIX Roman systems, it is WinAnsiEncoding
on Windows and MacRomanEncoding
on Mac OS. On UNIX (except HP-UX) Roman systems, it is ISO8859-1
(ISO Latin-1); for HP-UX, it is HP-ROMAN8
.
For descriptions of WinAnsiEncoding
, MacRomanEncoding
, and PDFDocEncoding
, see Annex D, "Character Sets and Encodings, in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, page 651.
You can find this document on the web store of the International Standards Organization (ISO).
For non-Roman systems, the host encoding may be a variety of encodings, which are defined by a CMap (character map). For a list of predefined CMaps see the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 9.7.5, page 272.
You can find this document on the web store of the International Standards Organization (ISO).
Use PDGetHostEncoding() to determine whether a system's host encoding is Roman.
ASUns8
*
*
PDGetPDFDocEncoding(
void
);
An array containing 256 elements. Each element corresponds to a code point in the PDFDocEncoding
, and is either NULL
or a pointer to a string.
If the element is NULL
, the code point refers to the same glyph in both host encoding and PDFDocEncoding
. If the element is non- NULL
, it points to a string containing the glyph name for the code point.
Gets the number of additional bytes required for the multi-byte character pointed to by cp
. If cp
points to a single-byte character, 0
is returned. This method makes it possible to determine the length of multi-byte character strings to allocate space for them.
This function is similar to the ANSI-C code:
mblen(cp,
MB_LEN_MAX)
-
1
or the Windows function:
IsDBCSLeadByte(cp)
ASInt32
PDHostMBLen(
const
char
*
cp
);
cp | The character to examine.
|
void
PDXlateToASText(
const
char
*
inHostString
,
ASInt32
inHostStringSize
,
ASText
outPDFString
);
inHostString | A pointer to the string to translate (it may point to the same memory as
outPDFString , allowing strings to translate in place). |
inHostStringSize | The number of bytes in the string to translate.
|
outPDFString | (Filled by the method) The text object corresponding to
inHostStringSize . The client must pass a valid ASText object title. The routine does not allocate it. |
outPDFString
. Translates a string from PDFDocEncoding
to host encoding. This method is useful when setting or retrieving displayed text that must be in PDFDocEncoding
(or Unicode), such as text that appears in a text annotation or bookmark.
A character that cannot be converted to the destination encoding is replaced with a space.
Host encoding is a platform-dependent encoding for the host machine. For non-UNIX Roman systems, it is MacRomanEncoding
on Mac OS and WinAnsiEncoding
on Windows. On UNIX (except HP-UX) Roman systems, it is ISO8859-1
(ISO Latin-1); for HP-UX, it is HP-ROMAN8
.
For descriptions of WinAnsiEncoding
, MacRomanEncoding
, and PDFDocEncoding
, see Annex D, "Character Sets and Encodings, in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, page 651.
You can find this document on the web store of the International Standards Organization (ISO).
For non-Roman systems, the host encoding may be a variety of encodings, which are defined by a CMap (character map). For a list of predefined CMaps see the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 9.7.5, page 272.
You can find this document on the web store of the International Standards Organization (ISO).
Use PDGetHostEncoding() to determine if a system's host encoding is Roman. For non-Roman systems, use PDXlateToHostEx().
In general, PDXlateToHostEx() can be called instead of PDXlateToHost() since PDXlateToHostEx() works for any host encoding.
void
PDXlateToHost(
char
*
in
,
char
*
out
,
ASInt32
numBytes
);
in | The string to translate (it may point to the same memory as
out , allowing strings to translate in place). |
out | (Filled by the method) The translated string (it may point to the same memory as
in ). |
numBytes | The number of bytes in the string to translate.
|
ASInt32
PDXlateToHostASText(
const
ASText
inPdfString
,
char
*
outHostString
,
ASInt32
outHostStringSize
);
inPdfString | The text object.
|
outHostString | (Filled by the method) A pointer to the translated string.
|
outHostStringSize | The length of the
outHostString buffer, in bytes. |
outHostString
. Translates a string from Unicode or PDFDocEncoding
to host encoding. This method is useful when setting or retrieving displayed text that might be in Unicode, such as text that appears in a text annotation or bookmark.
A character that cannot be converted to the destination encoding is replaced with a space.
Host encoding is a platform-dependent encoding for the host machine. For non-UNIX Roman systems, it is WinAnsiEncoding
on Windows and MacRomanEncoding
on Mac OS. On UNIX (except HP-UX) Roman systems, it is ISO8859-1
(ISO Latin-1); for HP-UX, it is HP-ROMAN8
.
For descriptions of WinAnsiEncoding
, MacRomanEncoding
, and PDFDocEncoding
, see Annex D, "Character Sets and Encodings, in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, page 651.
You can find this document on the web store of the International Standards Organization (ISO).
For non-Roman systems, the host encoding may be a variety of encodings, which are defined by a CMap (character map). For a list of predefined CMaps see the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1:PDF 1.7, section 9.7.5, page 272.
You can find this document on the web store of the International Standards Organization (ISO).
For non-Roman systems, use PDXlatetoHostEx(). Use PDGetHostEncoding() to determine whether the host encoding for a system is Roman.
In general, PDXlatetoHostEx() operates in the same way as PDXlateToHost() but requires an extra argument, since the sizes of the input and translated strings may differ. This method can be called instead of PDXlateToHost(), and must be called for multi-byte character set systems.
ASInt32
PDXlateToHostEx(
const
char
*
inPdfStr
,
ASInt32
inPdfStrSize
,
char
*
outHostStr
,
ASInt32
outHostStrSize
);
inPdfStr | IN/OUT A pointer to the string to translate (it may point to the same memory as
outHostStr , allowing strings to translate in place). |
inPdfStrSize | IN/OUT The length of
inPdfStr in bytes. |
outHostStr | IN/OUT (Filled by the method) A pointer to the translated string (it may point to the same memory as
inPdfStr ). |
outHostStrSize | IN/OUT The length of the
outHostStr buffer in bytes. |
outHostStr
. Translates a string from host encoding to PDFDocEncoding
. This method is useful when setting or retrieving displayed text that must be in PDFDocEncoding
(or Unicode), such as text that appears in a text annotation or bookmark.
A character that cannot be converted to the destination encoding is replaced with a space. For example, PDXlateToPDFDocEnc() converts '\\n'
to a space character ( '\\r'
is present in PDFDocEncoding
and is left unchanged).
Host encoding is a platform-dependent encoding for the host machine. For non-UNIX Roman systems, it is WinAnsiEncoding
on Windows and MacRomanEncoding
on Mac OS. On UNIX (except HP-UX) Roman systems, it is ISO8859-1
(ISO Latin-1); for HP-UX, it is HP-ROMAN8
.
For descriptions of WinAnsiEncoding
, MacRomanEncoding
, and PDFDocEncoding
, see Annex D, "Character Sets and Encodings, in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, page 651.
You can find this document on the web store of the International Standards Organization (ISO).
For non-Roman systems, the host encoding may be a variety of encodings, which are defined by a CMap (character map). For a list of predefined CMaps see the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 9.7.5, page 272.
You can find this document on the web store of the International Standards Organization (ISO).
Use PDGetHostEncoding() to determine if a system's host encoding is Roman. For non-Roman systems, use PDXlateToPDFDocEncEx().
In general, PDXlateToPDFDocEncEx() can be called instead of PDXlateToPDFDocEnc(), since PDXlateToPDFDocEncEx() works for PDFDocEncoding or Unicode.
void
PDXlateToPDFDocEnc(
char
*
in
,
char
*
out
,
ASInt32
numBytes
);
in | The string to translate (it may point to the same memory as
out , allowing strings to translate in place). |
out | (Filled by the method) The translated string (it may point to the same memory as
in ). |
numBytes | The number of bytes in the string to translate.
|
Translates a string from host encoding to PDFDocEncoding
or Unicode. This method is useful when using text that must be in PDFDocEncoding
or Unicode, such as text in a text annotation, bookmark, or article title.
A character that cannot be converted to the destination encoding is replaced with a space. For example, PDXlateToPDFDocEncEx() converts '\\n'
to a space character ( '\\r'
is present in PDFDocEncoding
and is left unchanged).
Host encoding is a platform-dependent encoding for the host machine. For non-UNIX Roman systems, it is WinAnsiEncoding
on Windows and MacRomanEncoding
on Mac OS. On UNIX (except HP-UX) Roman systems, it is ISO8859-1
(ISO Latin-1); for HP-UX, it is HP-ROMAN8
.
For descriptions of WinAnsiEncoding
, MacRomanEncoding
, and PDFDocEncoding
, see Annex D, "Character Sets and Encodings, in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, page 651.
You can find this document on the web store of the International Standards Organization (ISO).
For non-Roman systems, the host encoding may be a variety of encodings, which are defined by a CMap (character map). For a list of predefined CMaps see the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 9.7.5, page 272.
You can find this document on the web store of the International Standards Organization (ISO).
For non-Roman systems, use PDXlateToPDFDocEncEx(). You can use PDGetHostEncoding() to determine whether a system's host encoding is Roman.
In general, PDXlateToPDFDocEncEx() can be called instead of PDXlateToPDFDocEnc() since PDXlateToPDFDocEncEx() works for PDFDocEncoding or Unicode.
ASInt32
PDXlateToPDFDocEncEx(
ASBool
bUseUnicode
,
const
char
*
inHostStr
,
ASInt32
inHostStrSize
,
char
*
outPDFStr
,
ASInt32
outPDFStrSize
);
bUseUnicode | If
true , translate the string to Unicode; otherwise use PDFDocEncoding . |
inHostStr | A pointer to the string to translate (it may point to the same memory as
outPDFStr , allowing strings to translate in place). |
inHostStrSize | The number of bytes in the string to translate.
|
outPDFStr | (Filled by the method) A pointer to the translated string (it may point to the same memory as
inHostStr ). |
outPDFStrSize | The length of the
outPDFStr buffer, in bytes. |
outPDFStr
.