SaveOptionsAllowEmbeddingPostScriptFonts Property

Gets or sets a boolean value indicating whether to allow embedding fonts with PostScript outlines when embedding TrueType fonts in a document upon it is saved. The default value is false.

Namespace:  Aspose.Words.Saving
Assembly:  Aspose.Words (in Aspose.Words.dll) Version: 21.4.0

ExpandedSyntax

public bool AllowEmbeddingPostScriptFonts { get; set; }

Property Value

Type: Boolean

ExpandedRemarks

Note, Word does not embed PostScript fonts, but can open documents with embedded fonts of this type.

This option only works when EmbedTrueTypeFonts of the FontInfos property is set to true.

ExpandedExamples

Shows how to save the document with PostScript font.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

builder.Font.Name = "PostScriptFont";
builder.Writeln("Some text with PostScript font.");

// Load the font with PostScript to use in the document.
MemoryFontSource otf = new MemoryFontSource(File.ReadAllBytes(FontsDir + "AllegroOpen.otf"));
doc.FontSettings = new FontSettings();
doc.FontSettings.SetFontsSources(new FontSourceBase[] { otf });

// Embed TrueType fonts.
doc.FontInfos.EmbedTrueTypeFonts = true;

// Allow embedding PostScript fonts while embedding TrueType fonts.
// Microsoft Word does not embed PostScript fonts, but can open documents with embedded fonts of this type.
SaveOptions saveOptions = SaveOptions.CreateSaveOptions(SaveFormat.Docx);
saveOptions.AllowEmbeddingPostScriptFonts = true;

doc.Save(ArtifactsDir + "Document.AllowEmbeddingPostScriptFonts.docx", saveOptions);

ExpandedSee Also