Font Attributes

 

Attribute

Description

Type

OriginalName

Font name as was found in the PDF file.

String

FontName

Usually the same as OriginalName unless the font was not loaded from a PDF.

String

BaseName

Font name after it has been processed, e.g. can be the name of the system font being used.

String

FontType

PDF Font Type, can be TrueType, Type1, Type3

String

Embedding

0: Not embedded, 1: partially, 2: fully embedded.

Integer

IsWinAnsiEncoding

Flag set if the font follows WinAnsiEncoding

Boolean

System

Flag set to 1 if the font is also present on the system.

Boolean

HasCharMap

Flag is set to True if the font has a unicode character map.

Boolean

Encoding

PDF Font Encoding.

String

Processed

Font was already processed (i.e. used in a parsed page.)

Boolean

 

Example

Sub Sample()
    ' Constants for Activation codes
    Const strLicenseTo As String = "Amyuni PDF Creator Evaluation"
    Const strActivationCode As String = "07EFCDAB010001004282943F2AF19A88F332D9E781E40460727DF8A42847A1BDE06DB61C71E94E2D90424BF8762385335F9D6884E9FC"
 
    ' Initializing PDFCreativeX Object
    Dim pdf As ACPDFCREACTIVEX.PDFCreactiveX = New ACPDFCREACTIVEX.PDFCreactiveX()
 
    ' Set license key
    pdf.SetLicenseKey(strLicenseTo, strActivationCode)
 
    ' Open an existent PDF file
    Dim fileName As String = "c:\temp\PDFdocument.pdf"
    Dim password As String = ""
    pdf.Open(fileName, password)
 
    ' Get All the OBjects in the First Page
    Dim objArray() As System.Object = pdf.ObjectAttribute("Document", "Fonts")
    For Each obj As ACPDFCREACTIVEX.IacObject In objArray
        Console.WriteLine(obj.Attribute("FontName"))
        Console.WriteLine(obj.Attribute("FontType"))
        Console.WriteLine(obj.Attribute("Encoding"))
    Next
End Sub
static void Sample()
{
    // Constants for Activation codes
    const string strLicenseTo = "Amyuni PDF Creator Evaluation";
    const string strActivationCode = "07EFCDAB010001004282943F2AF19A88F332D9E781E40460727DF8A42847A1BDE06DB61C71E94E2D90424BF8762385335F9D6884E9FC";
 
    // Initializing PDFCreativeX Object
    ACPDFCREACTIVEX.PDFCreactiveX pdf = new ACPDFCREACTIVEX.PDFCreactiveX();
 
    // Set license key
    pdf.SetLicenseKey(strLicenseTo, strActivationCode);
 
    // Open an existent PDF file
    string fileName = @"c:\temp\PDFdocument.pdf";
    string password = "";
    pdf.Open(fileName, password);
 
    // Get All the Objects in the First Page
    System.Object[] objArray = pdf.ObjectAttribute["Document", "Fonts"];
    foreach (ACPDFCREACTIVEX.IacObject obj in objArray)
    {
        Console.WriteLine(obj["FontName"]);
        Console.WriteLine(obj["FontType"]);
        Console.WriteLine(obj["Encoding"]);
    }
}
#include <iostream>
#import "c:\users\amyuni\pdfcreactivex.dll" no_namespace
 
using namespace std;
 
int main()
{
    // Constants for Activation codes
    bstr_t strLicenseTo = "Amyuni PDF Creator Evaluation";
    bstr_t strActivationCode = "07EFCDAB010001004282943F2AF19A88F332D9E781E40460727DF8A42847A1BDE06DB61C71E94E2D90424BF8762385335F9D6884E9FC";
 
    // Initialize the COM subsystem
    CoInitialize(0);
 
    // IPDFCreactiveXPtr is a smart pointer type defined in pdfcreactivex.tlh,
    // the type library header file generated by the #import instruction above
    IPDFCreactiveXPtr pdf;
 
    // Create the PDFCreactiveX instance
    pdf.CreateInstance(__uuidof(PDFCreactiveX));
 
    // set license key
    pdf->SetLicenseKey(_bstr_t(strLicenseTo), _bstr_t(strActivationCode));
 
    // Open an existent PDF file
    _bstr_t fileName = "c:\\temp\\PDFdocument.pdf";
    _bstr_t password = "";
    pdf->Open(fileName, password);
 
    _variant_t objects;
    pdf->get_ObjectAttribute(bstr_t("Document"), bstr_t("Fonts"), &objects);
    assert(objects.vt & (VT_ARRAY | VT_DISPATCH));
    SAFEARRAY *psa = objects.parray;
 
    LONG len = 0;
    len++;
    for (int i = 0; i < len; i++)
    {
        IacObjectPtr obj = ((LPDISPATCH*)(psa->pvData))[i];
        if (obj != NULL)
        {
            cout << _bstr_t(obj->Attribute["FontName"]) << endl;
            cout << _bstr_t(obj->Attribute["FontType"]) << endl;
            cout << _bstr_t(obj->Attribute["Encoding"]) << endl;
        }
    }
    SafeArrayUnlock(psa);
 
    return 0;
}