You’re viewing outdated documentation. View the latest Customer’s Canvas On-Premises documentation.

RenderHiRes Method (Product, RenderingConfig)

Applies to: Customer's Canvas On-Premises; Design Atoms .NET 6.0.0, 6.x (may differ) · Archived documentation

Renders a Product to the cache

Generates a collection of image IDs in the cache, which represent hi-res outputs for single pages of the Product.

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

Syntax

C#
public IEnumerable<string> RenderHiRes(
	Product product,
	RenderingConfig renderingConfig
)

Parameters

product

Type: Aurigma.DesignAtoms.Model.Product

A Product to render.
renderingConfig

Type: Aurigma.DesignAtoms.Configuration.RenderingConfig.RenderingConfig

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

Return Value

A collection of image IDs in the cache. To retrieve images by IDs, you can use the GetReadStream() method.

Examples

C#
// Instantiate IProductRenderer.
var renderer = Injector.Instance.Resolve<IProductRenderer>();
// Get the identifier of the first rendered page.
var cacheId = renderer.RenderHiRes(product).First();

// Instantiate IFileCache to retrieve the hi-res output.
var fileCache = Injector.Instance.Resolve<IFileCache>();
// Save the hi-res output to a file.
using (var stream = fileCache.GetReadStream(cacheId))
using (var fileStream = File.Create("product.pdf"))
    stream.CopyTo(fileStream);

See Also

Reference