Acquiring Fonts; Example 4.3; Creating A Pdecontent Object; Acquiring A Font That Is Used To Draw Text On A Page - Adobe ACROBAT SDK 8.1 Manual

Developing plug-ins and applications
Table of Contents

Advertisement

Adobe Acrobat SDK
Developing Plug-ins and Applications

Example 4.3

PDEContent pdeContent;
pdeContent = PDPageAcquirePDEContent(pdPage, NULL);

Acquiring fonts

You must acquire the font that you will use to insert text into a PDF document. You can reference a font
that is installed on the host computer by creating a
PDEFont
the following tasks:
1. Create a
2. Allocate the size of the
3. Set the
For example, you can specify
you can specify
values, see the Acrobat and PDF Library API Reference.
4. Create a
arguments:
The address of the
Size of the
A value that specifies a
Acrobat and PDF Library API Reference.
5. Create a
PDEFontCreateFromSysFont
A
PDSysFont
An
can pass
Acrobat and PDF Library API Reference.
The following code example acquires a font that is used to draw text on a page.
Example 4.4
PDSysFont sysFont;
PDEFont pdeFont;
//Set the size of the PDSysFont and set its attributes
memset(&pdeFontAttrs, 0, sizeof(pdeFontAttrs));
pdeFontAttrs.name = ASAtomFromString("CourierStd");
pdeFontAttrs.type = ASAtomFromString("Type1");
//Get system font
sysFont = PDFindSysFont(&pdeFontAttrs, sizeof(PDEFontAttrs), 0);
//Create a font that is used to draw text on a page
pdeFont = PDEFontCreateFromSysFont(sysFont, kPDEFontDoNotEmbed);

Creating a PDEContent object

object, which represents the font that is used to draw text on a page. To acquire a font, perform
object.
PDEFontAttrs
PDEFontAttrs
object's
PDEFontAttrs
CourierStd
, which is a Type 1 PostScript font. For information about valid font subtype
Type1
object by invoking the
PDSysFont
PDEFontAttrs
PDEFontAttrs
PDSysFontMatchFlags
object that represents the font to use within a PDF document by invoking the
PDEFont
object that references a system font.
value that indicates whether to embed the font or whether to subset the font. You
ASUnit32
kPDEFontDoNotEmbed

Acquiring a font that is used to draw text on a page

PDSysFont
object's buffer by using the
and
attributes. The
name
type
. The
attribute defines the font subtype. For example,
type
PDFindSysFont
object.
object in bytes.
value. For information about this value, see the
method and passing the following arguments:
to this argument. For information about other values, see the
Inserting Text into PDF Documents
object and use this object to create a
method.
memset
attribute defines the font name.
name
method and passing the following
Acquiring fonts
64

Advertisement

Table of Contents
loading

Table of Contents