VintaSoft Imaging .NET SDK 14.0: Documentation for .NET developer
Vintasoft.Imaging.Pdf.Processing Namespace / PdfDocumentCompressorCommand Class / SubsetFonts Property
Syntax Example Requirements SeeAlso
In This Topic
    SubsetFonts Property (PdfDocumentCompressorCommand)
    In This Topic
    Gets or sets a value indicating whether the command must subset fonts in PDF document.
    Syntax
    'Declaration
    
    <DefaultValueAttribute(False)>
    <CategoryAttribute("Cleanup")>
    <DescriptionAttribute("A value indicating whether the command must subset fonts.")>
    Public Property SubsetFonts As Boolean
    
    
    [DefaultValue(False)]
    [Category("Cleanup")]
    [Description("A value indicating whether the command must subset fonts.")]
    public bool SubsetFonts { get; set; }
    
    
    [DefaultValue(False)]
    [Category("Cleanup")]
    [Description("A value indicating whether the command must subset fonts.")]
    public: __property bool get_SubsetFonts();
    public: __property void set_SubsetFonts(
    bool value
    );
    [DefaultValue(False)]
    [Category("Cleanup")]
    [Description("A value indicating whether the command must subset fonts.")]
    public:
    property bool SubsetFonts { bool get(); void set(bool value); }

    Property Value

    True - command must subset fonts; false - command must NOT subset fonts.
    Default value is false.
    Example

    Here is an example that shows how to subset fonts in PDF document:

    
    ''' <summary>
    ''' Subsets fonts in PDF document.
    ''' </summary>
    ''' <param name="inPdfFilename">The input PDF filename.</param>
    ''' <param name="outPdfFilename">The output PDF filename.</param>
    Public Shared Sub SubsetFonts(inPdfFilename As String, outPdfFilename As String)
        ' create compressor with empty compression settings
        Dim compressor As Vintasoft.Imaging.Pdf.Processing.PdfDocumentCompressorCommand = Vintasoft.Imaging.Pdf.Processing.PdfDocumentCompressorCommand.CreateEmptyCompressor()
    
        ' specify that compressor must subset fonts in PDF document
        compressor.SubsetFonts = True
    
        ' compress PDF document
        compressor.Compress(inPdfFilename, outPdfFilename)
    End Sub
    
    
    
    /// <summary>
    /// Subsets fonts in PDF document.
    /// </summary>
    /// <param name="inPdfFilename">The input PDF filename.</param>
    /// <param name="outPdfFilename">The output PDF filename.</param>
    public static void SubsetFonts(string inPdfFilename, string outPdfFilename)
    {
        // create compressor with empty compression settings
        Vintasoft.Imaging.Pdf.Processing.PdfDocumentCompressorCommand compressor =
           Vintasoft.Imaging.Pdf.Processing.PdfDocumentCompressorCommand.CreateEmptyCompressor();
    
        // specify that compressor must subset fonts in PDF document
        compressor.SubsetFonts = true;
    
        // compress PDF document
        compressor.Compress(inPdfFilename, outPdfFilename);
    }
    
    

    Requirements

    Target Platforms: .NET9; .NET 8; .NET 7; .NET 6; .NET Framework 4.8, 4.7, 4.6, 4.5, 4.0, 3.5

    See Also