Click or drag to resize

PdfFontEmbeddingPolicyProvider Delegate

This delegate represents a method of function that will be called when a request has come to embed a particular font within a PDF. Client code will be passed a font resource and the embedding permissions that are contained within the font's data. The permissions describe the circumstances under which the font may be embedded. It is up to client code to respect these permissions.

Namespace:  Atalasoft.PdfDoc.Generating.ResourceHandling.Fonts
Assembly:  Atalasoft.PdfDoc (in Atalasoft.PdfDoc.dll) Version: 11.4.0.9.0.377 (.NET 4.5.2, x86)
Syntax
public delegate PdfFontEmbeddingPolicy PdfFontEmbeddingPolicyProvider(
	PdfFontResource resource,
	PdfFontEmbeddingPermission permissions
)

Parameters

resource
Type: Atalasoft.PdfDoc.Generating.ResourceHandling.FontsPdfFontResource
The font resource that is needs an embedding policy.
permissions
Type: Atalasoft.PdfDoc.Generating.ResourceHandling.FontsPdfFontEmbeddingPermission
The permissions for the font resource.

Return Value

Type: PdfFontEmbeddingPolicy
A new PdfFontEmbeddingPolicy describing the embedding action to take for this font.
Examples
There a number of different actions that client code could take for a request to embed a font. In general, if there is doubt as to what action to take, not embedding is the safest.
private PdfFontEmbeddingPolicy MyEmbeddingPolicyProvider(PdfFontResource resource, PdfFontEmbeddingPermission permissions)
{
    PdfFontEmbeddingAction action = PdfFontEmbeddingAction.DontEmbed;
    switch (permissions) {
    case PdfFontEmbeddingPermission.Unrestricted:
    case PdfFontEmbeddingPermission.PreviewAndPrint:
    case PdfFontEmbeddingPermission.NoSubsetting:
        action = PdfFontEmbeddingAction.Embed;
        break;
    }
    return new PdfFontEmbeddingPolicy(action);
}
See Also