Click or drag to resize

PdfFontManager Class

PdfFontManager is a class that is used by the GlobalResources class to maintain and manage fonts within PDF documents. In addition to tracking which fonts are requested, PdfFontManager also handles policy decisions for embedding fonts in PDF files. The choice to embed a font or not depends upon the circumstances. For example, some fonts may publish that they are not to be embedded without permission from the creator. Since the PDF Generating toolkit can't know if client code has permission for a given font, the action to be taken for embedding should be provided by client code where possible. The PdfFontManager contains a default policy which embeds the font when the permissions are PreviewAndPrint, Unrestricted, NoSubsetting, and Editable. In all other cases it will throw an exception.
Inheritance Hierarchy
SystemObject
  Atalasoft.PdfDoc.Generating.ResourceHandlingPdfResourceManagerPdfFontResource
    Atalasoft.PdfDoc.Generating.ResourceHandling.FontsPdfFontManager

Namespace:  Atalasoft.PdfDoc.Generating.ResourceHandling.Fonts
Assembly:  Atalasoft.PdfDoc (in Atalasoft.PdfDoc.dll) Version: 11.0.0.0.0.297 (.NET 4.5.2, x86)
Syntax
public class PdfFontManager : PdfResourceManager<PdfFontResource>

The PdfFontManager type exposes the following members.

Constructors
  NameDescription
Public methodPdfFontManager
Constructs a new instance of the PdfFontManager class and sets its default embedding policy. A PdfFontManager is constructed for client code in the GlobalResources class. Client code will rarely if ever need to construct this class.
Top
Properties
  NameDescription
Public propertyDefaultEmbeddingPolicyProvider
Gets the default embedding policy provider for the font manager.
Public propertyEmbeddingPolicyProvider
Gets or sets the embedding policy provider for the font resource manager.
Public propertyItem
Gets the resource with the specified s.
(Inherited from PdfResourceManagerT.)
Protected propertyResourceClass
Gets the resource class.
(Overrides PdfResourceManagerTResourceClass.)
Public propertyCode exampleResourceNames
Gets the resource names for this resource manager.
Examples
foreach (string name in globalResources.Images.ResourceNames) {
    Console.WriteLine("resource name: " + name);
}
(Inherited from PdfResourceManagerT.)
Public propertyStatic memberStandardType1Fonts
Gets a list of the standard Type 1 fonts.
Top
Methods
  NameDescription
Public methodCode exampleAdd(T)
Adds the specified resource with an auto-generated name.
(Inherited from PdfResourceManagerT.)
Public methodCode exampleAdd(String, T)
Adds a resource to the resource manager. Throws ArgumentException if a resource with the same name is already present.
(Inherited from PdfResourceManagerT.)
Public methodCode exampleAddFromFile
Adds a new font resource using a new unique name from from a path to a true type font file.
Public methodAddFromFont
Adds a new font resource using a new unique name from Font object.
Public methodCode exampleAddFromFontName
Adds a new font resource using a new unique named from the name of an installed font.
Public methodCode exampleAddStream
Adds a new font resource using a new unique name from a stream that contains a true type font.
Public methodContains
Determines whether or not the resource is present.
(Inherited from PdfResourceManagerT.)
Public methodDispose
Disposes all resources contained in this resource manager
(Inherited from PdfResourceManagerT.)
Protected methodDispose(Boolean)
Releases unmanaged and - optionally - managed resources
(Inherited from PdfResourceManagerT.)
Protected methodDisposeManagedResources
Disposes the managed resources.
(Inherited from PdfResourceManagerT.)
Protected methodDisposeUnmanagedResources
Disposes the unmanaged resources.
(Inherited from PdfResourceManagerT.)
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize (Inherited from PdfResourceManagerT.)
Public methodCode exampleFromFile
Constructs a new PdfFontResource from the path to a true type file.
Public methodFromFont
Constructs a new PdfFontResource from Font object.
Public methodCode exampleFromFontName
Constructs a new PdfFontResource from the name of a font.
Public methodFromStream
Constructs a new PdfFontResource from a stream that contains a true type font.
Public methodCode exampleGet
Gets a resource with the given name. Throws an exception if there is no resource present with that name.
(Inherited from PdfResourceManagerT.)
Public methodGetEmbeddingPolicy
Gets the embedding policy for a particular font. This method will be called by DocumentRenderer objects or PDF writer objects. There is typically no need to call it from client code. Calling this method from client code will not affect how any given font is embedded.
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodStatic memberIsStandardFont
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodMerge
Merges the set of resources, other, into this ResourceManager using the selector to resolve name conflicts.
(Inherited from PdfResourceManagerT.)
Public methodNextName
Returns the next available auto-generated name for this resource.
string name = someResourceManager.NextName();
someResourceManager.Add(name, someResource);
(Inherited from PdfResourceManagerT.)
Public methodRebuildAvailableFontList
When new font resources are constructed by font name (instead of using the font stream directly), the font manager uses a cached list of installed fonts on the client computer to avoid having to repeatedly search the available resources. An application should call this method if it wishes to invalidate the list. This would allow an application to be aware of new fonts installed while the application is running at the cost of some performance.
Public methodCode exampleRemove
Removes the resource of the specified name. Throws an ArgumentException if name is not present.
(Inherited from PdfResourceManagerT.)
Protected methodResourcesMatch
Compares two resources for equality. Default implementation returns false. Subclasses should override this method
(Overrides PdfResourceManagerTResourcesMatch(T, T).)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodCode exampleTryGet
Tries to get the specified resource.
(Inherited from PdfResourceManagerT.)
Top
See Also