Hi all
I've a Strange error...
The pdfviewer don't show anything but if i print the document it exists !
The code work normaly before i don't understand.....
this is the XAML code
<Window x:Class="TestPdfViewer.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:UC="clr-namespace:Angdm.Framework.UI.UserControls;assembly=Angdm.Framework.UI"
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
xmlns:local="clr-namespace:TestPdfViewer"
mc:Ignorable="d"
Title="MainWindow" Height="350" Width="525" Loaded="Window_Loaded">
<Grid >
<telerik:RadPdfViewer x:Name="pdfviewer"/>
<!--<UC:UCPdfViewer x:Name="pdfviewer" BorderBrush="Red"/>-->
</Grid>
</Window>
and the window loaded
private void Window_Loaded(object sender, RoutedEventArgs e)
{
using (FileStream fs = new FileStream("c:\\toto.pdf", FileMode.Open, FileAccess.Read))
{
byte[] byteread = new byte[fs.Length];
int numBytesToRead = (int)fs.Length;
int numBytesRead = 0;
while (numBytesToRead > 0)
{
int n = fs.Read(byteread, numBytesRead, numBytesToRead);
if (n == 0)
break;
numBytesRead += n;
numBytesToRead -= n;
}
numBytesToRead = byteread.Length;
MemoryStream m = new MemoryStream(byteread);
FormatProviderSettings settings = new FormatProviderSettings(ReadingMode.AllAtOnce);
PdfFormatProvider provider = new PdfFormatProvider(m, settings);
RadFixedDocument mdoc_data = provider.Import();
this.pdfviewer.ClearDocument();
this.pdfviewer.Document = mdoc_data;
}
}