Aspose::Words::Saving::SaveOptions::get_AllowEmbeddingPostScriptFonts method

SaveOptions::get_AllowEmbeddingPostScriptFonts method

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.

bool Aspose::Words::Saving::SaveOptions::get_AllowEmbeddingPostScriptFonts() const

Remarks

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.

Examples

Shows how to save the document with PostScript font.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);

builder->get_Font()->set_Name(u"PostScriptFont");
builder->Writeln(u"Some text with PostScript font.");

// Load the font with PostScript to use in the document.
auto otf = MakeObject<MemoryFontSource>(System::IO::File::ReadAllBytes(FontsDir + u"AllegroOpen.otf"));
doc->set_FontSettings(MakeObject<FontSettings>());
doc->get_FontSettings()->SetFontsSources(MakeArray<SharedPtr<FontSourceBase>>({otf}));

// Embed TrueType fonts.
doc->get_FontInfos()->set_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.
SharedPtr<SaveOptions> saveOptions = SaveOptions::CreateSaveOptions(SaveFormat::Docx);
saveOptions->set_AllowEmbeddingPostScriptFonts(true);

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

See Also