Dynamic Image Configuration
- 3-4 minutes to read
You can configure settings of the Dynamic Image application in the AppSettings.config
file:
<appSettings>
<!-- License key -->
<!--<add key="GraphicsMillLicenseKey" value="YOURLICENCEKEY" />-->
<!-- API security key. -->
<add key="ApiSecurityKey" value="" />
<!-- Defines server's URLs that appear in links to proof images and high-resolution outputs. -->
<add key="AppUrl" value="" />
<!-- Paths to the resources. -->
<add key="FontPath" value="..\Assets\fonts" />
<add key="ImagePath" value="..\Assets\images" />
<add key="TemplatePath" value="..\Assets\templates" />
<!-- Paths to the resulting hires files. -->
<add key="ResultHiresPath" value="..\Results\Pdf" />
<!-- Paths to the resulting preview files. -->
<add key="ResultPreviewPath" value="..\Results\Images" />
<!-- If `true`, it stores rendering results directly in the file system as .pdf and .png files.
If this value is `false`, then the files are stored in the internal format, and you can limit the size and expiration time for both storages of the resulting files. -->
<add key="SaveResultsToFileSystem" value="true" />
<!-- The expiration time for resulting hires files, in seconds. For example, 864000 is 10 days. -->
<add key="ResultHiresExpirationTimespan" value="0" />
<!-- The maximum size of the resulting hires files, in bytes. For example, 4294967296 is 4 GiB. -->
<add key="ResultHiresMaxSize" value="0" />
<!-- The expiration time for resulting preview files, in seconds. For example, 864000 is 10 days. -->
<add key="ResultPreviewExpirationTimespan" value="0" />
<!-- The maximum size of the resulting preview files, in bytes. For example, 4294967296 is 4 GiB. -->
<add key="ResultPreviewMaxSize" value="0" />
<!-- Paths to the cache. -->
<add key="CachePath" value=".\App_Data\Cache\FileCache" />
<add key="FontCachePath" value=".\App_Data\Cache\FontCache" />
<!-- Enables the cache. If true, it caches every render request. -->
<add key="EnableCache" value="true" />
<!-- Cache expiration time, in seconds. By default, it's 10 days. -->
<add key="CacheExpirationTimespan" value="864000" />
<!-- The maximum size of the cache, in bytes. By default, it's 4 GiB. -->
<add key="CacheMaxSize" value="4294967296" />
<!-- The resize interpolation mode for preview images. -->
<add key="PreviewResizeInterpolationMode" value="Anisotropic9" />
<!-- The vector frame to raster interpolation mode. -->
<add key="VectorFrameInterpolationMode" value="High" />
<!-- Allows for uploading images in the `ImagePath` folder through the Web API. -->
<add key="AllowUploadImages" value="true" />
<!-- The time interval, in seconds, which will be given for one attempt to download the inserted image. -->
<add key="ImageDownloadTimeout" value="100"/>
<!-- The maximum number of tasks for rendering proof images and hi-res outputs that the Dynamic Image can perform at the same time. -->
<add key="MaxConcurrentRenderingTasks" value="12" />
<!-- Preloads external images before the rendering. If `true`, it could speed up the rendering. -->
<add key="PreloadImages" value="false" />
<!-- An experimental optimization that speeds up the rendering of preview images, but may blur them. Use with caution. -->
<add key="OptimizePreview" value="false" />
<!-- Debugging and logging. -->
<add key="EnableSwagger" value="false" />
<add key="LogAllRequests" value="false" />
<add key="EnableDebugLogs" value="false" />
<!-- An experimental feature that helps when you have problems with asynchronous rendering SmartObject GC. -->
<add key="SyncGCRender" value="false" />
</appSettings>
These are the default values. For the complete list of available interpolation modes, you can refer to the GraphicsMill documentation.
When you specify a relative path to a template, this path will be combined with the path specified in the TemplatePath
parameter. For example, if TemplatePath
is "c:\inetpub\mockups"
, then specifying the /folder/my-mockup.psd template, Dynamic Image will refer to c:\inetpub\mockups\folder\my-mockup.psd. The path to images in the local gallery will be combined with the path specified in the ImagePath
parameter.
If you set EnableSwagger
to true
, then you can navigate to <your-DI-instance-url>/swagger and explore the interactive Web API in your browser.
If you have unzipped the application, assets, and user files to the default location, you can skip changing paths to the assets. Otherwise, you must specify their location in configuration files.
For example, let's assume that you need to install several Customer's Canvas applications and you implement the following hierarchy:
D:\inetpub\
\customerscanvas\
\apps\
\design-editor\
\6.20.7
\6.21.0
...
\dynamic-image\
\0.8.2
\0.15.11
...
\preflight-tool\
\1.5.2
\1.21.0
...
\data\
\assets\
\designs
\fonts
...
\userdata\
In this case, you must find and change the application settings in the following config file:
AppSettings.config (under the dynamic-image subfolder)
<!-- Paths to the resources. --> <add key="FontPath" value="..\..\..\data\assets\fonts" /> <add key="ImagePath" value="..\..\..\data\assets\images" /> <add key="TemplatePath" value="..\..\..\data\assets\designs" /> <!-- Paths to the resulting hires files. --> <add key="ResultHiresPath" value="..\..\..\data\results\dynamic-image\pdf" /> <!-- Paths to the resulting preview files. --> <add key="ResultPreviewPath" value="..\..\..\data\results\dynamic-image\images" />