VintaSoft Imaging .NET SDK v8.7
Vintasoft.Imaging.Codecs.Encoders Namespace / PdfMrcCompressionSettings Class
Members Example



In This Topic
    PdfMrcCompressionSettings Class
    In This Topic
    Class that contains settings for encoding of PDF document with MRC compression.
    Object Model
    PdfMrcCompressionSettings ClassPdfCompressionSettings ClassPdfCompressionSettings ClassImageSegmentationCommand ClassPdfCompressionSettings ClassProcessingCommandBase ClassPdfCompressionSettings Class
    Syntax
    'Declaration
     
    Public Class PdfMrcCompressionSettings 
    public class PdfMrcCompressionSettings 
    public __gc class PdfMrcCompressionSettings 
    public ref class PdfMrcCompressionSettings 
    Remarks
    A compression technology called PDF MRC (Mixed Raster Content) is used for minimizing the size of PDF and PDF/A files. PDF MRC compression algorithm analyzes the document image, locates picture objects and text regions on the document image, divides the document image onto layers and compress each layer with the best compression.

    Document image can be divided to the following layers:
    • Background layer - layer that contains objects which were not classified as picture or text.
    • Images layer - layer that contains picture objects (continuous-tone components)
    • Mask layer - layer that contains text
    • Front layer - layer that is used for coloring the text
    Example
    This example shows how to compress the document images, which contain text and pictures, using MRC compression algorithm and get the resulting images with high quality. This example shows how to compress the document images, which contain text and pictures, using MRC compression algorithm and get the resulting images with normal quality. This example shows how to compress the document images, which contain text and pictures, using MRC compression algorithm and get the resulting images with high compression ratio. This example shows how to compress the document images, which contain text only, using MRC compression algorithm and get the resulting images with high quality. This example shows how to compress the document images, which contain text only, using MRC compression algorithm and get the resulting images with normal quality. This example shows how to compress the document images, which contain text only, using MRC compression algorithm and get the resulting images with high compression ratio.
    Public Shared Sub SetSetting_DocumentWithImagesHiQuality(settings As Vintasoft.Imaging.Codecs.Encoders.PdfMrcCompressionSettings)
    	settings.CreateBackgroundLayer = True
    	settings.BackgroundLayerCompression = Vintasoft.Imaging.Pdf.PdfCompression.Jpeg Or Vintasoft.Imaging.Pdf.PdfCompression.Zip
    	settings.BackgroundLayerCompressionSettings.JpegQuality = 60
                
    	settings.ImageSegmentation = New Vintasoft.Imaging.ImageProcessing.Info.ImageSegmentationCommand()
    	settings.CreateImagesLayer = False
                
    	settings.HiQualityMask = True
    	settings.MaskCompression = Vintasoft.Imaging.Pdf.PdfCompression.Jbig2
    	settings.MaskCompressionSettings.Jbig2Settings.Lossy = True
                
    	settings.CreateFrontLayer = True
    	settings.HiQualityFrontLayer = True
    	settings.FrontLayerCompression = Vintasoft.Imaging.Pdf.PdfCompression.Jpeg2000
    	settings.FrontLayerCompressionSettings.Jpeg2000Settings.CompressionRatio = 300 * 3
    	settings.FrontLayerCompressionSettings.Jpeg2000Settings.CompressionType = Vintasoft.Imaging.Codecs.ImageFiles.Jpeg2000.Jpeg2000CompressionType.Lossy
    End Sub
    public static void SetSetting_DocumentWithImagesHiQuality(
        Vintasoft.Imaging.Codecs.Encoders.PdfMrcCompressionSettings settings)
    {
        settings.CreateBackgroundLayer = true;
        settings.BackgroundLayerCompression = 
            Vintasoft.Imaging.Pdf.PdfCompression.Jpeg | 
            Vintasoft.Imaging.Pdf.PdfCompression.Zip;
        settings.BackgroundLayerCompressionSettings.JpegQuality = 60;
                
        settings.ImageSegmentation =
            new Vintasoft.Imaging.ImageProcessing.Info.ImageSegmentationCommand();
        settings.CreateImagesLayer = false;
                
        settings.HiQualityMask = true;
        settings.MaskCompression = Vintasoft.Imaging.Pdf.PdfCompression.Jbig2;
        settings.MaskCompressionSettings.Jbig2Settings.Lossy = true;
                
        settings.CreateFrontLayer = true;
        settings.HiQualityFrontLayer = true;
        settings.FrontLayerCompression = Vintasoft.Imaging.Pdf.PdfCompression.Jpeg2000;
        settings.FrontLayerCompressionSettings.Jpeg2000Settings.CompressionRatio = 300 * 3;
        settings.FrontLayerCompressionSettings.Jpeg2000Settings.CompressionType = 
            Vintasoft.Imaging.Codecs.ImageFiles.Jpeg2000.Jpeg2000CompressionType.Lossy;
    }
    Public Shared Sub SetSetting_DocumentWithImagesNormal(settings As Vintasoft.Imaging.Codecs.Encoders.PdfMrcCompressionSettings)
    	settings.CreateBackgroundLayer = True
    	settings.BackgroundLayerCompression = Vintasoft.Imaging.Pdf.PdfCompression.Jpeg Or Vintasoft.Imaging.Pdf.PdfCompression.Zip
    	settings.BackgroundLayerCompressionSettings.JpegQuality = 35
                
    	settings.ImageSegmentation = New Vintasoft.Imaging.ImageProcessing.Info.ImageSegmentationCommand()
    	settings.CreateImagesLayer = False
                
    	settings.HiQualityMask = True
    	settings.MaskCompression = Vintasoft.Imaging.Pdf.PdfCompression.Jbig2
    	settings.MaskCompressionSettings.Jbig2Settings.Lossy = True
                
    	settings.CreateFrontLayer = True
    	settings.HiQualityFrontLayer = True
    	settings.FrontLayerCompression = Vintasoft.Imaging.Pdf.PdfCompression.Jpeg Or Vintasoft.Imaging.Pdf.PdfCompression.Zip
    	settings.FrontLayerCompressionSettings.JpegQuality = 25
    	settings.FrontLayerCompressionSettings.Jpeg2000Settings.CompressionRatio = 400 * 3
    	settings.FrontLayerCompressionSettings.Jpeg2000Settings.CompressionType = Vintasoft.Imaging.Codecs.ImageFiles.Jpeg2000.Jpeg2000CompressionType.Lossy
    End Sub
    public static void SetSetting_DocumentWithImagesNormal(
        Vintasoft.Imaging.Codecs.Encoders.PdfMrcCompressionSettings settings)
    {
        settings.CreateBackgroundLayer = true;
        settings.BackgroundLayerCompression = 
            Vintasoft.Imaging.Pdf.PdfCompression.Jpeg | 
            Vintasoft.Imaging.Pdf.PdfCompression.Zip;
        settings.BackgroundLayerCompressionSettings.JpegQuality = 35;
                
        settings.ImageSegmentation = 
            new Vintasoft.Imaging.ImageProcessing.Info.ImageSegmentationCommand();
        settings.CreateImagesLayer = false;
                
        settings.HiQualityMask = true;
        settings.MaskCompression = 
            Vintasoft.Imaging.Pdf.PdfCompression.Jbig2;
        settings.MaskCompressionSettings.Jbig2Settings.Lossy = true;
                
        settings.CreateFrontLayer = true;
        settings.HiQualityFrontLayer = true;
        settings.FrontLayerCompression = 
            Vintasoft.Imaging.Pdf.PdfCompression.Jpeg | 
            Vintasoft.Imaging.Pdf.PdfCompression.Zip;
        settings.FrontLayerCompressionSettings.JpegQuality = 25;
        settings.FrontLayerCompressionSettings.Jpeg2000Settings.CompressionRatio = 400 * 3;
        settings.FrontLayerCompressionSettings.Jpeg2000Settings.CompressionType = 
            Vintasoft.Imaging.Codecs.ImageFiles.Jpeg2000.Jpeg2000CompressionType.Lossy;
    }
    Public Shared Sub SetSetting_DocumentWithImagesHiCompression(settings As Vintasoft.Imaging.Codecs.Encoders.PdfMrcCompressionSettings)
    	settings.CreateBackgroundLayer = True
    	settings.BackgroundLayerCompression = Vintasoft.Imaging.Pdf.PdfCompression.Jpeg Or Vintasoft.Imaging.Pdf.PdfCompression.Zip
    	settings.BackgroundLayerCompressionSettings.JpegQuality = 20
                
    	settings.ImageSegmentation = New Vintasoft.Imaging.ImageProcessing.Info.ImageSegmentationCommand()
    	settings.CreateImagesLayer = False
                
    	settings.HiQualityMask = False
    	settings.MaskCompression = Vintasoft.Imaging.Pdf.PdfCompression.Jbig2
    	settings.MaskCompressionSettings.Jbig2Settings.Lossy = True
                
    	settings.CreateFrontLayer = True
    	settings.HiQualityFrontLayer = False
    	settings.FrontLayerCompression = Vintasoft.Imaging.Pdf.PdfCompression.Zip
    End Sub
    public static void SetSetting_DocumentWithImagesHiCompression(
        Vintasoft.Imaging.Codecs.Encoders.PdfMrcCompressionSettings settings)
    {
        settings.CreateBackgroundLayer = true;
        settings.BackgroundLayerCompression = 
            Vintasoft.Imaging.Pdf.PdfCompression.Jpeg | 
            Vintasoft.Imaging.Pdf.PdfCompression.Zip;
        settings.BackgroundLayerCompressionSettings.JpegQuality = 20;
                
        settings.ImageSegmentation = 
            new Vintasoft.Imaging.ImageProcessing.Info.ImageSegmentationCommand();
        settings.CreateImagesLayer = false;
                
        settings.HiQualityMask = false;
        settings.MaskCompression = Vintasoft.Imaging.Pdf.PdfCompression.Jbig2;
        settings.MaskCompressionSettings.Jbig2Settings.Lossy = true;
                
        settings.CreateFrontLayer = true;
        settings.HiQualityFrontLayer = false;
        settings.FrontLayerCompression = Vintasoft.Imaging.Pdf.PdfCompression.Zip;
    }
    Public Shared Sub SetSetting_DocumentNoImagesHiQuality(settings As Vintasoft.Imaging.Codecs.Encoders.PdfMrcCompressionSettings)
    	settings.CreateBackgroundLayer = True
    	settings.BackgroundLayerCompression = Vintasoft.Imaging.Pdf.PdfCompression.Jpeg Or Vintasoft.Imaging.Pdf.PdfCompression.Zip
    	settings.BackgroundLayerCompressionSettings.JpegQuality = 30
                
    	settings.ImageSegmentation = Nothing
    	settings.CreateImagesLayer = False
                
    	settings.HiQualityMask = True
    	settings.MaskCompression = Vintasoft.Imaging.Pdf.PdfCompression.Jbig2
    	settings.MaskCompressionSettings.Jbig2Settings.Lossy = True
                
    	settings.CreateFrontLayer = True
    	settings.HiQualityFrontLayer = True
    	settings.FrontLayerCompression = Vintasoft.Imaging.Pdf.PdfCompression.Jpeg2000
    	settings.FrontLayerCompressionSettings.Jpeg2000Settings.CompressionRatio = 300 * 3
    	settings.FrontLayerCompressionSettings.Jpeg2000Settings.CompressionType = Vintasoft.Imaging.Codecs.ImageFiles.Jpeg2000.Jpeg2000CompressionType.Lossy
    End Sub
    public static void SetSetting_DocumentNoImagesHiQuality(
        Vintasoft.Imaging.Codecs.Encoders.PdfMrcCompressionSettings settings)
    {
        settings.CreateBackgroundLayer = true;
        settings.BackgroundLayerCompression = 
            Vintasoft.Imaging.Pdf.PdfCompression.Jpeg | 
            Vintasoft.Imaging.Pdf.PdfCompression.Zip;
        settings.BackgroundLayerCompressionSettings.JpegQuality = 30;
                
        settings.ImageSegmentation = null;
        settings.CreateImagesLayer = false;
                
        settings.HiQualityMask = true;
        settings.MaskCompression = 
            Vintasoft.Imaging.Pdf.PdfCompression.Jbig2;
        settings.MaskCompressionSettings.Jbig2Settings.Lossy = true;
                
        settings.CreateFrontLayer = true;
        settings.HiQualityFrontLayer = true;
        settings.FrontLayerCompression = 
            Vintasoft.Imaging.Pdf.PdfCompression.Jpeg2000;
        settings.FrontLayerCompressionSettings.Jpeg2000Settings.CompressionRatio = 300 * 3;
        settings.FrontLayerCompressionSettings.Jpeg2000Settings.CompressionType = 
            Vintasoft.Imaging.Codecs.ImageFiles.Jpeg2000.Jpeg2000CompressionType.Lossy;
    }
    Public Shared Sub SetSetting_DocumentNoImagesNormal(settings As Vintasoft.Imaging.Codecs.Encoders.PdfMrcCompressionSettings)
    	settings.CreateBackgroundLayer = True
    	settings.BackgroundLayerCompression = Vintasoft.Imaging.Pdf.PdfCompression.Jpeg Or Vintasoft.Imaging.Pdf.PdfCompression.Zip
    	settings.BackgroundLayerCompressionSettings.JpegQuality = 25
                
    	settings.ImageSegmentation = Nothing
    	settings.CreateImagesLayer = False
                
    	settings.HiQualityMask = True
    	settings.MaskCompression = Vintasoft.Imaging.Pdf.PdfCompression.Jbig2
    	settings.MaskCompressionSettings.Jbig2Settings.Lossy = True
                
    	settings.CreateFrontLayer = True
    	settings.HiQualityFrontLayer = False
    	settings.FrontLayerCompression = Vintasoft.Imaging.Pdf.PdfCompression.Jpeg2000
    	settings.FrontLayerCompressionSettings.Jpeg2000Settings.CompressionRatio = 350 * 3
    	settings.FrontLayerCompressionSettings.Jpeg2000Settings.CompressionType = Vintasoft.Imaging.Codecs.ImageFiles.Jpeg2000.Jpeg2000CompressionType.Lossy
    End Sub
    public static void SetSetting_DocumentNoImagesNormal(
        Vintasoft.Imaging.Codecs.Encoders.PdfMrcCompressionSettings settings)
    {
        settings.CreateBackgroundLayer = true;
        settings.BackgroundLayerCompression = 
            Vintasoft.Imaging.Pdf.PdfCompression.Jpeg | 
            Vintasoft.Imaging.Pdf.PdfCompression.Zip;
        settings.BackgroundLayerCompressionSettings.JpegQuality = 25;
                
        settings.ImageSegmentation = null;
        settings.CreateImagesLayer = false;
                
        settings.HiQualityMask = true;
        settings.MaskCompression = 
            Vintasoft.Imaging.Pdf.PdfCompression.Jbig2;
        settings.MaskCompressionSettings.Jbig2Settings.Lossy = true;
                
        settings.CreateFrontLayer = true;
        settings.HiQualityFrontLayer = false;
        settings.FrontLayerCompression = 
            Vintasoft.Imaging.Pdf.PdfCompression.Jpeg2000;
        settings.FrontLayerCompressionSettings.Jpeg2000Settings.CompressionRatio = 350 * 3;
        settings.FrontLayerCompressionSettings.Jpeg2000Settings.CompressionType = 
            Vintasoft.Imaging.Codecs.ImageFiles.Jpeg2000.Jpeg2000CompressionType.Lossy;
    }
    Public Shared Sub SetSetting_DocumentNoImagesHiCompression(settings As Vintasoft.Imaging.Codecs.Encoders.PdfMrcCompressionSettings)
    	settings.CreateBackgroundLayer = True
    	settings.BackgroundLayerCompression = Vintasoft.Imaging.Pdf.PdfCompression.Jpeg Or Vintasoft.Imaging.Pdf.PdfCompression.Zip
    	settings.BackgroundLayerCompressionSettings.JpegQuality = 20
                
    	settings.ImageSegmentation = Nothing
    	settings.CreateImagesLayer = False
                
    	settings.HiQualityMask = False
    	settings.MaskCompression = Vintasoft.Imaging.Pdf.PdfCompression.Jbig2
    	settings.MaskCompressionSettings.Jbig2Settings.Lossy = True
                
    	settings.CreateFrontLayer = True
    	settings.HiQualityFrontLayer = False
    	settings.FrontLayerCompression = Vintasoft.Imaging.Pdf.PdfCompression.Jpeg2000
    	settings.FrontLayerCompressionSettings.Jpeg2000Settings.CompressionRatio = 450 * 3
    	settings.FrontLayerCompressionSettings.Jpeg2000Settings.CompressionType = Vintasoft.Imaging.Codecs.ImageFiles.Jpeg2000.Jpeg2000CompressionType.Lossy
    End Sub
    public static void SetSetting_DocumentNoImagesHiCompression(
        Vintasoft.Imaging.Codecs.Encoders.PdfMrcCompressionSettings settings)
    {
        settings.CreateBackgroundLayer = true;
        settings.BackgroundLayerCompression = 
            Vintasoft.Imaging.Pdf.PdfCompression.Jpeg | 
            Vintasoft.Imaging.Pdf.PdfCompression.Zip;
        settings.BackgroundLayerCompressionSettings.JpegQuality = 20;
                
        settings.ImageSegmentation = null;
        settings.CreateImagesLayer = false;
                
        settings.HiQualityMask = false;
        settings.MaskCompression = 
            Vintasoft.Imaging.Pdf.PdfCompression.Jbig2;
        settings.MaskCompressionSettings.Jbig2Settings.Lossy = true;
                
        settings.CreateFrontLayer = true;
        settings.HiQualityFrontLayer = false;
        settings.FrontLayerCompression = 
            Vintasoft.Imaging.Pdf.PdfCompression.Jpeg2000;
        settings.FrontLayerCompressionSettings.Jpeg2000Settings.CompressionRatio = 450 * 3;
        settings.FrontLayerCompressionSettings.Jpeg2000Settings.CompressionType = 
            Vintasoft.Imaging.Codecs.ImageFiles.Jpeg2000.Jpeg2000CompressionType.Lossy;
    }
    Inheritance Hierarchy

    System.Object
       Vintasoft.Imaging.Codecs.Encoders.PdfMrcCompressionSettings

    Requirements

    Target Platforms: Windows 10, Windows 8, Windows 7, Windows Vista, Windows XP, Windows Server 2012, Windows Server 2008, Windows Server 2003

    See Also