I'm getting one error while opening multiple PDF files and displaying them to RadBook.

4 posts, 0 answers
  1. Leonardo
    Leonardo avatar
    1 posts
    Member since:
    Jul 2011

    Posted 07 Jun 2012 Link to this post

    Hi Now I'm getting one error while opening multiple PDF files and displaying them to RadBook.

    I'm getting the error during navigating pages or open PDF.

    "Object reference not set to an instance of an object."

    Error occurs at Telerik.Windows.Documents.UI.FixedDocumentSinglePagePresenter.LoadPageContent.AnonymousMethod__1()

    Following is the souce code


            private ObservableCollection<AttachFileInfo> _attachedFiles;
            public ObservableCollection<AttachFileInfo> AttachedFiles
            {
                get
                {
                    return _attachedFiles;
                }
                set
                {
                    if (_attachedFiles != value)
                    {
                        _attachedFiles = value;
                        NotifyPropertyChanged("AttachedFiles");


                        OpenPDFFiles();
                    }
                }
            }


            private IEnumerable<RadFixedPage> _pages;
            public IEnumerable<RadFixedPage> Pages
            {
                get
                {
                    return _pages;
                }
                set
                {
                    if (_pages != value)
                    {
                        _pages = value;
                        NotifyPropertyChanged("Pages");
                    }
                }
            }

    if (AttachedFiles != null)
                {
                    int step = 0;


                    if (attachDocumentStream != null)
                    {
                        foreach (Stream attachStream in attachDocumentStream)
                        {
                            attachStream.Close();
                            attachStream.Dispose();
                        }
                    }


                    attachDocumentStream = new List<Stream>(AttachedFiles.Count);
                    foreach (AttachFileInfo AttachFile in AttachedFiles)
                    {


                        attachDocumentStream.Add(File.Open(AttachFile.FilePath, FileMode.Open));
                        doc = new PdfFormatProvider(attachDocumentStream[step], FormatProviderSettings.ReadOnDemand).Import();
                        DataStore.TotalPages = DataStore.TotalPages+ doc.Pages.Count;
                        Pages = Pages.Concat(doc.Pages);


                        step = step + 1;
                    }
                } 
  2. Kammen
    Admin
    Kammen avatar
    312 posts

    Posted 07 Jun 2012 Link to this post

    Hello Leonardo,

    Is it possible to send us a sample project that will help us better understand your case and find the best solution for your problem.

    In order to submit the file, you can open a support ticket by logging into your account at http://www.telerik.com and following these steps:

    1.       From your account, choose "Contact Support Team";
    2.       Click the "Submit support ticket" button under RadControls for WPF and fill in the required information about the product and version of the control your inquiry is about.

    3.       At the very bottom, choose “Attach files” – you can see that the size limitation is 20 MB. Mind the allowed file types – in your case you should compress the file and attach it as a zip.

    Regards,

    Kammen
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. UI for WPF is Visual Studio 2017 Ready
  4. TEST
    TEST avatar
    4 posts
    Member since:
    Jul 2012

    Posted 07 Aug 2012 Link to this post

    Hi,

     I am also getting same error while loading multiple file dynamically. But not find any solution....

  5. Iva Toteva
    Admin
    Iva Toteva avatar
    1319 posts

    Posted 09 Aug 2012 Link to this post

    Hello,

    We are still not able to reproduce the issue. Unfortunately, there is no way to address the problem in this way.

    If you open a support ticket and attach a sample project illustrating the behavior you are observing, we will be happy to assist you further.

    Regards,
    Iva Toteva
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top