Document Solutions for PDF
Features / Output Intents
In This Topic
    Output Intents
    In This Topic

    Output intents describe the color characteristics of output devices on which the PDF document might be rendered.

    DsPdf uses the OutputIntents property to specify the output intents of a GcPdfDocument class. The OutputIntent class represents a PDF output intent and provides the Create method to create an output intent. The output intent subtype can also be set by using the Subtype property of OutputIntent class and has the following types:

    An output intent can be used in conjunction with the ICC profiles to convert the source colors to those required for the intended output. The ICC profiles are used for describing the output intents in PDF/A, PDF/X and PDF/VT standards. DsPdf provides the ICCProfile class which represents the ICC profile required to create the output intent. To know more about Output Intents, see PDF specification 2.0 (refer section 14.11.5)

    Refer to the following code example to set output intents and ICC profiles in a PDF document:

    C#
    Copy Code
    // The different versions of the ICC Probe profile
    var profiles = new (string, string)[] {
        ("Probev2_ICCv4.icc", @"https://www.color.org/probeprofile.xalter"),
        ("Probev1_ICCv4.icc", @"https://www.color.org/probeprofile.xalter"),
        ("Probev1_ICCv2.icc", @"https://www.color.org/probeprofile.xalter"),
    };
               
    var doc = new GcPdfDocument();
    var page = doc.NewPage();
    var g = page.Graphics;
    var sb = new StringBuilder();
    const string bullet = "\x2022\x2003";
    sb.AppendLine("This document contains the following output intents (first one is the default):");
    int i = 0;
    foreach (var profile in profiles)
    {
        sb.AppendLine($"{bullet}{profile.Item1}, source: {profile.Item2}");
        using (FileStream fs = File.OpenRead(Path.Combine("Resources", "Misc", profile.Item1)))
        {
            var oi = OutputIntent.Create($"Output intent testing {i++}", "", "http://www.color.org", profile.Item1, fs);
            doc.OutputIntents.Add(oi);
        }
    }
    var rc = Common.Util.AddNote(sb.ToString(), page);
    g.DrawImage(Image.FromFile(Path.Combine("Resources", "Images", "roofs.jpg")),
        new RectangleF(rc.Left, rc.Bottom + 24, rc.Width, rc.Width), null, ImageAlign.StretchImage);
                
    doc.Save(stream);
    

    The above code example uses the ICC Probe Profile whose colors are deliberately distorted after processing, so that it is easy to visually confirm that a profile is being used. To see the effect in the PDF, you can open it in Adobe Acrobat Reader DC and set Edit > Preferences > Page Display > Use Overprint Preview to 'Always', as shown below:

    Before setting the 'Use Overprint Preview' option After setting the 'Use Overprint Preview' option

    Note: The ICC profiles used in the above code can be downloaded from ICC Profile Registry.