Error when rendering PDF with RadBook with Silverlight 4 runtime, but fine with Silverlight 5 runtime

6 posts, 0 answers
  1. Alexandre BARBIER
    Alexandre BARBIER avatar
    14 posts
    Member since:
    May 2009

    Posted 20 Jul 2012 Link to this post

    Hi there

    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 !
  2. Lancelot
    Lancelot avatar
    251 posts
    Member since:
    Jul 2012

    Posted 20 Jul 2012 Link to this post

    Hi Alexandre,

    This is actually a Silverlight problem. The PDF rendering engine under RadPdfViewer is the Silverlight engine. There are many known issues surrounding the limitations of the Silverlight engine. There have been some improvements in Silverlight 5 and that's why you are getting better results when running against SL5.

    I had the same question not too long ago and they informed that they are actually building their own PDF rendering engine from scratch. There is no promised release date but they conveyed they're are working hard on it. I personally won't be surprised to see it running RadPdfViewer in the Q3 release.

    Is there a reason that you have to use SL4? Even when it is released, it will be built with SL5 and you'd have the same issues.

    Good luck
    Lancelot
  3. DevCraft banner
  4. Alexandre BARBIER
    Alexandre BARBIER avatar
    14 posts
    Member since:
    May 2009

    Posted 20 Jul 2012 Link to this post

    Lancelot,
    Tks for your reply
    I targeted SL4 for runtime because my app must be used into a company that had deployed only SL4 plugin onto the 10000 computer of the group... I cant say to the IT team "you must deployed SL5 plugin now !" it is a "too big work" :(
  5. Lancelot
    Lancelot avatar
    251 posts
    Member since:
    Jul 2012

    Posted 20 Jul 2012 Link to this post

    Yeah, I can see the logistics for that can be troublesome. The good thing is all each client has to do is have SL5. If you were to deploy the SL5 built app, the browser would inform them they need an update. It would take maybe 15 minutes for each person? 

    Or are these machines only on the internal network and the IT team has to install SL5 manually? It is a headache, but if the 10,000 group has internet access it would be really worth the effort. Telerik's new controls are faster, lighter and more dependable than ever now that the SL5 plugin is available.

    Either way, good luck with your goals!
    Lancelot
  6. Alexandre BARBIER
    Alexandre BARBIER avatar
    14 posts
    Member since:
    May 2009

    Posted 20 Jul 2012 Link to this post

    Unfortunately the company's computers have internet access but are all under Global policies management that prevent Browser plugin install :(
  7. Iva Toteva
    Admin
    Iva Toteva avatar
    1319 posts

    Posted 25 Jul 2012 Link to this post

    Hi Alexandre,

    Lancelot is right that overall Silverlight 5 works better than Silverlight 4 in most cases. However, we are trying to support both versions.

    The exception that you have initially reported is due to the fact that the document contains fonts that are not recognized in Silverlight. We have made some changes, so that an exception would not be thrown in such cases and it is quite probable that the issue is resolved in 2012 Q2.

    Please, try downloading the latest version of the controls or the service pack, which is expected in less than a week, and let us know how it goes.

    Greetings,
    Iva Toteva
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top
DevCraft banner