RadRichTextBoxRibbonUI Save as Pdf or Docx

2 posts, 0 answers
  1. Dennis
    Dennis avatar
    3 posts
    Member since:
    Mar 2014

    Posted 04 Sep 2014 Link to this post

    Hi,
    im trying to save my text as .pdf and .docx but I cant because it's an 'unsupported file format'. There are no exceptions or anything like that and I also added the Telerik.Windows.Documents.FormatProviders.Pdf...etc. references but still there isn't the option to save as .pdf or .docx. But I can save as .html or .rtf.


    <telerik:RadRibbonBackstage >
    <telerik:RadRibbonBackstageItem Header="Neu" Icon="pack://application:,,,/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/16/new.png" IsSelectable="false" telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=NewDocumentCommand}" />
    <telerik:RadRibbonBackstageItem Header="Öffnen" Icon="pack://application:,,,/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/16/open.png" IsSelectable="false" telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=OpenDocumentCommand}" />
    <telerik:RadRibbonBackstageItem Header="Speichern" Icon="pack://application:,,,/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/16/save.png" IsSelectable="false" telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=SaveCommand}" />
    <telerik:RadRibbonBackstageItem Header="Speichern als" Icon="pack://application:,,,/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/16/saveas.png" IsDefault="false">
    <StackPanel HorizontalAlignment="Stretch" Margin="20,20,0,0">
    <TextBlock FontFamily="Verdana" FontSize="18" FontWeight="ExtraBold" Foreground="#FF5E5E7C" Text="Speichern als" />
    <Rectangle Fill="Gray" Height="1" HorizontalAlignment="Left" Width="410" />
    <StackPanel Margin="0,30,0,0" Orientation="Horizontal">
    <telerik:RadRibbonButton BorderBrush="Gray" CommandParameter="docx" CornerRadius="3" Height="80" telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=SaveCommand}" telerik:RadRichTextBoxRibbonUI.ShouldCloseBackstage="true" Width="90">
    <StackPanel Width="90">
    <Image HorizontalAlignment="Center" Source="pack://application:,,,/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/ApplicationMenu/worddoc.png" Stretch="None" />
    </StackPanel>
    </telerik:RadRibbonButton>
    <StackPanel Margin="20,0,0,0">
    <TextBlock FontSize="18" FontWeight="ExtraBold" Foreground="#FF5E5E7C" Text="Word Dokument" />
    <TextBlock FontFamily="Verdana" FontSize="13" Text="Datei als Word Dokument speichern." TextWrapping="Wrap" Width="300" />
    </StackPanel>
    </StackPanel>
    <StackPanel Margin="0,30,0,0" Orientation="Horizontal">
    <telerik:RadRibbonButton BorderBrush="Gray" CommandParameter="pdf" CornerRadius="3" Height="80" telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=SaveCommand}" telerik:RadRichTextBoxRibbonUI.ShouldCloseBackstage="true" Width="90">
    <StackPanel Width="90">
    <Image HorizontalAlignment="Center" Source="pack://application:,,,/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/ApplicationMenu/Pdf.png" Stretch="None" />
    </StackPanel>
    </telerik:RadRibbonButton>
    <StackPanel Margin="20,0,0,0">
    <TextBlock FontSize="18" FontWeight="ExtraBold" Foreground="#FF5E5E7C" Text="PDF Dokument" />
    <TextBlock FontFamily="Verdana" FontSize="13" Text="Datei als PDF speichern." TextWrapping="Wrap" Width="300" />
    </StackPanel>
    </StackPanel>
    <StackPanel Margin="0,30,0,0" Orientation="Horizontal">
    <telerik:RadRibbonButton BorderBrush="Gray" CommandParameter="html" CornerRadius="3" Height="80" telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=SaveCommand}" telerik:RadRichTextBoxRibbonUI.ShouldCloseBackstage="true" Width="90">
    <StackPanel Width="90">
    <Image HorizontalAlignment="Center" Source="pack://application:,,,/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/ApplicationMenu/html.png" Stretch="None" />
    </StackPanel>
    </telerik:RadRibbonButton>
    <StackPanel Margin="20,0,0,0">
    <TextBlock FontSize="18" FontWeight="ExtraBold" Foreground="#FF5E5E7C" Text="HTML Dokument" />
    <TextBlock FontFamily="Verdana" FontSize="13" Text="Datei als HTML Dokument speichern." TextWrapping="Wrap" Width="300" />
    </StackPanel>
    </StackPanel>
    <StackPanel Margin="0,30,0,0" Orientation="Horizontal">
    <telerik:RadRibbonButton BorderBrush="Gray" CommandParameter="rtf" CornerRadius="3" Height="80" telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=SaveCommand}" telerik:RadRichTextBoxRibbonUI.ShouldCloseBackstage="true" Width="90">
    <StackPanel Width="90">
    <Image HorizontalAlignment="Center" Source="pack://application:,,,/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/ApplicationMenu/Rtf.png" Stretch="None" />
    </StackPanel>
    </telerik:RadRibbonButton>
    <StackPanel Margin="20,0,0,0">
    <TextBlock FontSize="18" FontWeight="ExtraBold" Foreground="#FF5E5E7C" Text="Rich Text Format" />
    <TextBlock FontFamily="Verdana" FontSize="13" Text="Dokument in Rich Text Format speichern." TextWrapping="Wrap" Width="300" />
    </StackPanel>
    </StackPanel>
    <StackPanel Margin="0,30,0,0" Orientation="Horizontal">
    <telerik:RadRibbonButton BorderBrush="Gray" CommandParameter="txt" CornerRadius="3" Height="80" telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=SaveCommand}" telerik:RadRichTextBoxRibbonUI.ShouldCloseBackstage="true" Width="90">
    <StackPanel Width="90">
    <Image HorizontalAlignment="Center" Source="pack://application:,,,/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/ApplicationMenu/PlainText.png" Stretch="None" />
    </StackPanel>
    </telerik:RadRibbonButton>
    <StackPanel Margin="20,0,0,0">
    <TextBlock FontSize="18" FontWeight="ExtraBold" Foreground="#FF5E5E7C" Text="Einfacher Text" />
    <TextBlock FontFamily="Verdana" FontSize="13" Text="Dokument als einfachen Text speichern." TextWrapping="Wrap" Width="300" />
    </StackPanel>
    </StackPanel>
    </StackPanel>
    </telerik:RadRibbonBackstageItem>
    <telerik:RadRibbonBackstageItem Header="Print" Icon="pack://application:,,,/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/16/print.png" IsDefault="true">
    <StackPanel HorizontalAlignment="Stretch" Margin="20,20,0,0">
    <TextBlock FontFamily="Verdana" FontSize="18" FontWeight="ExtraBold" Foreground="#FF5E5E7C" Text="Drucken" />
    <Rectangle Fill="Gray" Height="1" HorizontalAlignment="Left" Width="410" />
    <StackPanel Margin="0,30,0,0" Orientation="Horizontal">
    <telerik:RadRibbonButton BorderBrush="Gray" CommandParameter="Native" CornerRadius="3" Height="80" telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=PrintCommand}" telerik:RadRichTextBoxRibbonUI.ShouldCloseBackstage="true" Width="90">
    <StackPanel Width="90">
    <Image HorizontalAlignment="Center" Source="pack://application:,,,/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/ApplicationMenu/pagesetup.png" Stretch="None" />
    </StackPanel>
    </telerik:RadRibbonButton>
    <StackPanel Margin="20,0,0,0">
    <TextBlock FontSize="18" FontWeight="ExtraBold" Foreground="#FF5E5E7C" Text="Direkter Druck" />
    <TextBlock FontFamily="Verdana" FontSize="13" Text="Sendet das Dokument direkt an den standart Drucker ohne änderungen." TextWrapping="Wrap" Width="300" />
    </StackPanel>
    </StackPanel>
    </StackPanel>
    </telerik:RadRibbonBackstageItem>
    </telerik:RadRibbonBackstage>

    thank you in advance!

    Dennis
  2. Petya
    Admin
    Petya avatar
    975 posts

    Posted 08 Sep 2014 Link to this post

    Hi Dennis,

    Please make sure you've added a reference to the Telerik.Windows.Zip.dll as well, as it is needed to export documents in DOCX and PDF format. You can also try the suggestion from this help section as it is possible that MEF is not loading the respective format providers.

    I hope this is useful.

    Regards,
    Petya
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top