Exemplo n.º 1
0
        /// <summary>
        /// Converts FB2 inline image
        /// </summary>
        /// <returns></returns>
        public IHTMLItem Convert(InlineImageItem inlineImageItem,InlineImageConverterParamsV2 inlineImageConverterParams)
        {
            if (inlineImageItem == null)
            {
                throw new ArgumentNullException("inlineImageItem");
            }
            var img = new Image(HTMLElementType.XHTML11);
            img.Alt.Value = inlineImageItem.AltText ?? string.Empty; // ePub require image always to have attribute

            img.Source.Value = inlineImageConverterParams.Settings.ReferencesManager.AddImageRefferenced(inlineImageItem, img);

            SetClassType(img, ElementStylesV2.InlineImage);
            return img;
        }
Exemplo n.º 2
0
        /// <summary>
        /// Converts FB2 inline image
        /// </summary>
        /// <returns></returns>
        public IHTMLItem Convert(InlineImageItem inlineImageItem, InlineImageConverterParamsV2 inlineImageConverterParams)
        {
            if (inlineImageItem == null)
            {
                throw new ArgumentNullException("inlineImageItem");
            }
            var img = new Image(HTMLElementType.XHTML11);

            img.Alt.Value = inlineImageItem.AltText ?? string.Empty; // ePub require image always to have attribute

            img.Source.Value = inlineImageConverterParams.Settings.ReferencesManager.AddImageRefferenced(inlineImageItem, img);

            SetClassType(img, ElementStylesV2.InlineImage);
            return(img);
        }