I've got a strange issue by trying to display some PDF into RadBook.
I'm using the Silvberlight 4 Dll of the Q1 2012 Release, I did the following code to display a PDF :
private
OpenFileDialog dialog;
private
Stream documentStream;
private
void
CloseStream()
{
if
(
this
.documentStream !=
null
)
{
this
.documentStream.Close();
this
.documentStream.Dispose();
}
}
private
void
Open_Click(
object
sender, System.Windows.RoutedEventArgs e)
{
if
(
this
.dialog.ShowDialog() ==
true
)
{
this
.CloseStream();
#if SILVERLIGHT
this
.documentStream =
this
.dialog.File.OpenRead();
#elif WPF
this
.documentStream =
this
.dialog.OpenFile();
#endif
RadFixedDocument doc =
new
PdfFormatProvider(
this
.documentStream, FormatProviderSettings.ReadOnDemand).Import();
this
.book.ItemsSource = doc.Pages;
}
}
If I run this on a computer with the Silverlight 5 runtime, all of my PDF are displayed with no issue.
If I run this on a computer with the Silverlight 4 runtime, I've got some of my PDF that are not completly displayed (some page are blank, seems to be thus with text because picture can be shown) and I got this errors :
Message: Unhandled Error in Silverlight Application Error HRESULT E_FAIL has been returned from a call to a COM component. at MS.Internal.XcpImports.CheckHResult(UInt32 hr)
at MS.Internal.XcpImports.Collection_AddValue[T](PresentationFrameworkCollection`1 collection, CValue value)
at MS.Internal.XcpImports.Collection_AddDependencyObject[T](PresentationFrameworkCollection`1 collection, DependencyObject value)
at System.Windows.PresentationFrameworkCollection`1.AddDependencyObject(DependencyObject value)
at System.Windows.Controls.UIElementCollection.AddInternal(UIElement value)
at Telerik.Windows.Documents.UI.FixedDocumentUIElementFactory.CreatePageContentElementsInPanel(Panel container, RadFixedPage page)
at Telerik.Windows.Documents.UI.FixedDocumentSinglePagePresenter.<LoadPageContent>b__1()
Line: 1
Char: 1
Code: 0
URI: http://localhost:27061/radbooktestTestPage.aspx
Message: Unhandled Error in Silverlight Application Error HRESULT E_FAIL has been returned from a call to a COM component. at MS.Internal.XcpImports.CheckHResult(UInt32 hr)
at MS.Internal.XcpImports.Collection_AddValue[T](PresentationFrameworkCollection`1 collection, CValue value)
at MS.Internal.XcpImports.Collection_AddDependencyObject[T](PresentationFrameworkCollection`1 collection, DependencyObject value)
at System.Windows.PresentationFrameworkCollection`1.AddDependencyObject(DependencyObject value)
at System.Windows.Controls.UIElementCollection.AddInternal(UIElement value)
at Telerik.Windows.Documents.UI.FixedDocumentUIElementFactory.CreatePageContentElementsInPanel(Panel container, RadFixedPage page)
at Telerik.Windows.Documents.UI.FixedDocumentSinglePagePresenter.<LoadPageContent>b__1()
Line: 1
Char: 1
Code: 0
URI: http://localhost:27061/radbooktestTestPage.aspx
Is it a kwnown issue ? Is there a workaround ? could you reproduce this issue ?
I can sent the PDF that makes this issue if you gives me an email for that...
Thanks for help !