TrophyCustomer's Canvas is honored with a 2020 InterTech Technology Award! Learn more 

RenderHiRes Method (Stream, Product, DataSet, RenderingConfig)

Renders a personalized Product to a Stream.

Namespace: Aurigma.DesignAtoms.Rendering
Assembly: Aurigma.DesignAtoms (in Aurigma.DesignAtoms.dll)

Syntax

C#
public void RenderHiRes(
	Stream stream,
	Product product,
	DataSet data,
	RenderingConfig renderingConfig
)

Parameters

stream

Type: System.IO.Stream

An output Stream.
product

Type: Aurigma.DesignAtoms.Model.Product

A Product used as a template to create personalized copies.
data

Type: Aurigma.DesignAtoms.Model.DataSet

A DataSet providing variable data for the personalization. For more details about this parameter, you can refer to the Rendering Web API topic.
renderingConfig

Type: Aurigma.DesignAtoms.Configuration.RenderingConfig.RenderingConfig

Rendering properties. When you skip this parameter or pass null, the dafault configuration is applied.

Remarks

This method renders a product based on a DataSet - a collection of personalization rules. When you need a simple personalization rule, you can use the RenderHiRes(Stream, Product, SurfaceData, RenderingConfig) method allowing you to specify a SurfaceData.

Examples

C#
// Create an output file.
using (var fileStream = File.Create("vdp.pdf"))
{
    // Specify the personalization data.
    var surfaceData = new List<ItemsData> { new ItemsData
    {
        RootItems = new ItemDataCollection
        {
            { "Title", new ItemData {Text = "Premium Printing"} },
            { "CompanyLogo", new ItemData {Image = "https://example.com/logo.svg"} }
        }
    }};
    // Initialize a data set.
    var vdpData = new DataSet()
    {
        SurfacesData = new SurfaceDataCollection()
    };
    // Select surfaces and provide personalization data.
    vdpData.SurfacesData.Add(new SurfaceData
    {
        SurfaceBinding = new SurfaceBinding(0),
        Data = surfaceData
    });

    // Instantiate IProductRenderer and render the hi-res output.
    var renderer = Injector.Instance.Resolve<IProductRenderer>();
    renderer.RenderHiRes(fileStream, product, vdpData);
}

See Also

Reference

Manual