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

RadRichTextBoxRibbonUI Save as Pdf or Docx

1 Answer 69 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Dennis
Top achievements
Rank 1
Dennis asked on 04 Sep 2014, 02:17 PM
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

1 Answer, 1 is accepted

Sort by
0
Petya
Telerik team
answered on 08 Sep 2014, 04:52 PM
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.
 
Tags
RichTextBox
Asked by
Dennis
Top achievements
Rank 1
Answers by
Petya
Telerik team
Share this question
or