Renders a personalized Product to a Stream.
Namespace:
Aurigma.DesignAtoms.Rendering
Assembly:
Aurigma.DesignAtoms (in Aurigma.DesignAtoms.dll)
public void RenderHiRes( Stream stream, Product product, DataSet data, RenderingConfig renderingConfig )
Type: System.IO.Stream
An output Stream.Type: Aurigma.DesignAtoms.Model.Product
A Product used as a template to create personalized copies.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.Type: Aurigma.DesignAtoms.Configuration.RenderingConfig.RenderingConfig
Rendering properties. When you skip this parameter or passnull
, the dafault configuration is applied.// 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); }