Exemplo n.º 1
0
        public object Create(string value, Definitions.IDefinition definition)
        {
            _renderer.Settings = Settings.Copy();
            definition.TransformSettings(_renderer.Settings);

            if (!definition.IsDataValid(value))
                throw new BarcodeException();

            var codes = definition.GetCodes(value);
            var dt = definition.GetDisplayText(value);

            if (definition.IsChecksumRequired || _renderer.Settings.IsChecksumCalculated)
                dt = definition.AddChecksum(dt, codes);

            _renderer.Definition = definition;

            return _renderer.Render(codes, dt);
        }