This is a migrated thread and some comments may be shown as answers.

RadDocument Image printing as HTML with Base64EncodedSplit Issue

1 Answer 170 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Muhammad
Top achievements
Rank 1
Muhammad asked on 30 Aug 2016, 05:44 PM
Dear Admin,

we have a serious issue and needs urgent response we are paid user of telerik.we programmatically load image in RadRicTextbox then we print image this through Radrichtextbox control the solution works fine with IE11 but for IE8.0 some image are shown half. when we saw the generated HTML it seems that the images that are shown broken on browser pop up are not using Base64EncodedSplit as the HTML Have only one <img> tag. These images are also attached for reference. 

RadDocument docu = new RadDocument();
                    docu.LayoutMode = DocumentLayoutMode.Flow;
 
 
 
                    Telerik.Windows.Documents.Model.Section section = new Telerik.Windows.Documents.Model.Section();
                    Telerik.Windows.Documents.Model.Paragraph p1 = new Telerik.Windows.Documents.Model.Paragraph();
 
 
                    ImageInline img1 = new ImageInline(stream1);
 
                    p1.TextAlignment = RadTextAlignment.Center;
                    p1.Inlines.Add(img1);
 
 
                    section.Blocks.Add(p1);
 
 
                    docu.Sections.Add(section);
 
                    this.richTextbox.Document = docu;
                    this.richTextbox.UpdateLayout();

 
private void btnPrint_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                var obj = RadCompositionInitializer.Catalog;
 
               HtmlExportSettings exp = new HtmlExportSettings();
                
 
               exp.ImageExportMode = Telerik.Windows.Documents.FormatProviders.Html.ImageExportMode.Base64EncodedSplit;
                
               exp.DocumentExportLevel = DocumentExportLevel.Fragment;
               exp.StyleRepositoryExportMode = StyleRepositoryExportMode.DontExportStyles;
               exp.StylesExportMode = StylesExportMode.Inline;
               exp.ExportFontStylesAsTags = true ;
 
              
 
               RadCompositionInitializer.Catalog = new TypeCatalog(typeof(Telerik.Windows.Documents.FormatProviders.Html.HtmlFormatProvider));
               PrintSettings settings = new PrintSettings()
                {
                    HtmlPrintExportSettings = exp,
                    DocumentName = "My document",
                    PrintMode = Telerik.Windows.Documents.UI.PrintMode.HtmlPreview,
                    UseDefaultPrinter = true,
                    PrintScaling = Telerik.Windows.Documents.UI.PrintScaling.None
                };
                this.richTextbox.Print(settings);
                RadCompositionInitializer.Catalog = obj;
            }
            catch (Exception ex)
            {
 
                MessageBox.Show(ex.Message);
            }
}

1 Answer, 1 is accepted

Sort by
0
Mihail
Telerik team
answered on 01 Sep 2016, 12:47 PM
Hello Usman,

I am afraid that I couldn't manage to reproduce the issue. The generated HTML contains the image as multiple <img> tags with base64 encoded data.

Could you please open a support ticket with attached a simple working demo project illustrating the described problem? Could you also provide information about the version of the assemblies you are using?

Regards,
Mihail
Telerik by Progress
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Tags
RichTextBox
Asked by
Muhammad
Top achievements
Rank 1
Answers by
Mihail
Telerik team
Share this question
or