Cuminas DjVu SDK for .NET Framework
DjVu Encoder Profiles

A DjVu encoder profile are a set of DjVu encoding parameters and normally specified by a name.

For example, for 300 dpi scanned images, we typically uses scan300 profile. It tunes the encoding parameters for such kind of images from scanning devices.

Profile Repository

Profiles are normally installed in a profile repository. Document Express 7 products typically shares a profile repository installed as C:\ProgramData\Caminova\dp0.dprepo (Case of Windows Vista or later; the actual path may be different depending on operating systems.) The file uses XML structure to preserve multiple profiles in a file.

Almost encoding classes/methods accepts the profile name and they will try to load the encoding configuration from that profile. So the profile repository (the XML file) should be prepared (installed) before calling such encoding classes/methods. Typically installing Document Express 7 products or Profile Editor will finishes the preparation.

If dp0.dprepo file does not exist, you can only use sdk_default profile, which is embedded to the SDK.

Of course, you can deploy dp0.dprepo file either manually or automatically using some special method depending on your deployment case.

Using Profiles

Loading of a profile by encoding method is relatively easy. The following fragment tries to load scan300 profile using EncoderParams Constructor:

Copy Code
EncoderParams encParam = new EncoderParams("scan300");

But you don't have a way to install/initialize the profile repository, you can still load a profile from any dprepo (XML) file using CreateFromXmlFile Method:

Copy Code
EncoderParams encParam = EncoderParams.CreateFromXmlFile(@"C:\work\MyOwnProfile.dprepo");

 Or even you can specify the profile XML directly on your code using CreateFromXml Method:

Copy Code
EncoderParams encParam = EncoderParams.CreateFromXml(
@"<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
<repository xmlns='http://www.celartem.com/djvu/1.0/profile/' version='1.0'>
  <profile name='myconfig300' dict-freq='20' flex-encode='yes' gamma='2.5' read-only='yes'>
    <jb2 match-threshold='4' refine-threshold='63' center-diff-threshold='2' max-palettes='256' />
    <region-recog dist-long-max='60' dist-short-max='24' noise-threshold='3' color-threshold='10' overlap-threshold='9' />
    <iw44 id='foreground' intent='FG44' cbcr-mode='normal' cbcr-delay='auto' subsample='12' quality='75' />
    <iw44 id='background' intent='BG44' cbcr-mode='normal' cbcr-delay='auto' subsample='3' quality='75' />
    <segmenter block-size='16' max-size-of-noise-obj='4' noise-hue-threshold='8' upsample='1' blur-radius='1' detect-edge='no' thicken-shapes='no' use-fg-if-empty='no' />
  </profile>
</repository>");
For the complete sample, see Convert image to DjVu.
See Also

Tutorials

Send Feedback