Back to Devexpress

PdfExportOptions.NeverEmbeddedFonts Property

corelibraries-devexpress-dot-xtraprinting-dot-pdfexportoptions-eec4f7bb.md

latest4.1 KB
Original Source

PdfExportOptions.NeverEmbeddedFonts Property

Gets or sets a semicolon-delimited string of values with the font names which should not be embedded in the resulting PDF file.

Namespace : DevExpress.XtraPrinting

Assembly : DevExpress.Printing.v25.2.Core.dll

NuGet Package : DevExpress.Printing.Core

Declaration

csharp
[DefaultValue("")]
public string NeverEmbeddedFonts { get; set; }
vb
<DefaultValue("")>
Public Property NeverEmbeddedFonts As String

Property Value

TypeDefaultDescription
StringString.Empty

A String which contains the font names delimited by a semicolon.

|

Property Paths

You can access this nested property as listed below:

LibraryObject TypePath to NeverEmbeddedFonts
Cross-Platform Class LibraryExportOptions

.Pdf .NeverEmbeddedFonts

| | WinForms Controls | DiagramOptionsExport |

.PdfExportOptions .NeverEmbeddedFonts

| | WPF Controls | DiagramControl |

.PdfExportOptions .NeverEmbeddedFonts

|

Remarks

Use the NeverEmbeddedFonts property to specify which fonts should not be embedded into the resulting PDF file. Set NeverEmbeddedFonts to the “*” value to never embed any fonts.

Do not embed fonts from your documents to reduce the PDF file size. However, non-embedded fonts should be installed on the client machine where the PDF file is viewed. Otherwise, symbols from this font are substituted by default font symbols, or even displayed incorrectly.

When you use non-embedded fonts, the export engine can only use a subset of 256 characters.

All other fonts not listed in the NeverEmbeddedFonts property are automatically included into the resulting PDF file.

At present, the following limitations apply to PDF export.

  • Glyph Shaping does not work for non-embedded fonts.
  • Support for right-to-left languages with non-embedded fonts requires that your application runs under full trust.

Example

The code sample below illustrates how to specify a list of fonts that should not be embedded into the PDF file.

csharp
using DevExpress.XtraPrinting;

// ...

    public partial class XtraReport1 : DevExpress.XtraReports.UI.XtraReport {
        public XtraReport1() {
            var pdfExportOptions = new PdfExportOptions();
            pdfExportOptions.NeverEmbeddedFonts = "Arial;Tahoma;Calibri";
            this.ExportToPdf("Report.pdf", pdfExportOptions);
        }

    }
vb
Imports DevExpress.XtraPrinting

' ...

    Partial Public Class XtraReport1
        Inherits DevExpress.XtraReports.UI.XtraReport

        Public Sub New()
            Dim pdfExportOptions = New PdfExportOptions()
            pdfExportOptions.NeverEmbeddedFonts = "Arial;Tahoma;Calibri"
            Me.ExportToPdf("Report.pdf", pdfExportOptions)
        End Sub

    End Class

See Also

Export to PDF

PdfExportOptions Class

PdfExportOptions Members

DevExpress.XtraPrinting Namespace