Two PdfViewer controls at the same time on one screen loaded through streams

Given the folowing: FlLayPanel with PdfViewer control (one and only ;-)

ToonDocument(@"D:\marce\Downloads\vw.pdf", null);
ToonDocument(@"D:\marce\Downloads\pr.pdf", null);

Is no problem, both PdfViewer are showing correctly.

But with two streams, the is showing correctly, the second is showing a waitcycle (see attachment).

                using (FileStream s = new FileStream(@"D:\marce\Downloads\vw.pdf", FileMode.Open, FileAccess.Read))
                {
                    MemoryStream ms = new MemoryStream();
                    s.CopyTo(ms);
                    ToonDocument(string.Empty, ms);
                }

                using (FileStream s = new FileStream(@"D:\marce\Downloads\pr.pdf", FileMode.Open, FileAccess.Read))
                {
                    MemoryStream ms = new MemoryStream();
                    s.CopyTo(ms);
                    ToonDocument(string.Empty, ms);
                }
The sub to create the panel:

        public void ToonDocument(string documentnaam, MemoryStream stream = null)
        {
            UiDocPanel uiDocPanel = new UiDocPanel();
            if (documentnaam != string.Empty)
                uiDocPanel.LoadDoc(documentnaam);
            else
                uiDocPanel.LoadDoc(stream);

            dcmMain.SetDockLabel(uiDocPanel.FlLayPanel, "Document");
            dcmMain.SetEnableDocking(uiDocPanel.FlLayPanel, true);
        }

And the class UiDocPanel

using Syncfusion.Windows.Forms.PdfViewer;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace va.WinUI
{
    class UiDocPanel : UiPanel
    {
        private PdfViewerControl pdfView = new PdfViewerControl();

        public UiDocPanel() : base("Document")
        {
            InitControls();
        }

        public void LoadDoc(MemoryStream stream)
        {
            pdfView.Load(stream);
        }

        public void LoadDoc(String bestandsnaam)
        {
            pdfView.Load(bestandsnaam);
        }

        private void InitControls()
        {
            pdfView.Location = new System.Drawing.Point(6, 3);
            pdfView.Size = new System.Drawing.Size(963, 445);

            FlLayPanel.Resize += new System.EventHandler(Doc_Resize);
            FlLayPanel.Controls.Add(pdfView);
        }

        private void Doc_Resize(object sender, EventArgs e)
        {
            pdfView.Width = FlLayPanel.Width - 8;
            pdfView.Height = FlLayPanel.Height -10;
        }

    }
}

And the class UiPanel

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace va.WinUI
{
    class UiPanel
    {
        private FlowLayoutPanel panel = new FlowLayoutPanel();
        private string iBaseName = "Panel";

        public string Basename
        {
            get
            {
                return iBaseName;
            }

            set
            {
                iBaseName = value;
            }
        }

        public FlowLayoutPanel FlLayPanel
        {
            get
            {
                return panel ?? null;
            }
        }

        public UiPanel(string bname)
        {
            Basename = bname;

            // panel
            panel.BorderStyle = BorderStyle.Fixed3D;
            panel.Location = new System.Drawing.Point(1, 1);
            panel.Name = "pan" + Basename;
            panel.Size = new System.Drawing.Size(627, 161);
            panel.TabIndex = 2;
        }
    }
}

See attachment:

Attachment: PDFViewer_4da0c66.zip

8 Replies

KE Kathiravan Elangovan Syncfusion Team January 8, 2018 12:33 PM UTC

Hi Marcel, 

We have created a simple sample using the details provided in your previous update. By using this sample, We can reproduce the reported issue “PDF Viewer control displaying a loading indicator and it could not be load a PDF document in PDF Viewer Windows Forms” inconsistently in our end. Please find the sample from the following link,

http://www.syncfusion.com/downloads/support/directtrac/general/ze/ReplicationSample310414973

However we will validate this issue and provide you more details on 10th January 2018. Meanwhile, Can you please confirm us whether the sample we created was similar to the sample you used it in your end to reproduce the issue? If not, then we request you to modify the above sample and it will help us while investigating further on the issue in our end. 

Note : We can reproduce this reported issue 5 times out of 10 times using this sample. 

Regards, 
Kathiravan E


MW Marcel Wagenaar January 9, 2018 04:23 PM UTC

Hello Kathiravan,
I've upgraded to Synfusion the latest version and compiled your project: it runs OK om my desktop, on my laptop only de first PDF comes up, the second gives an waitcursor.
Attached you will  find two small PDF files that will course PdfViewer to show the waitcursor. The size does matter....

Regards, Marcel

Attachment: ExamplePDF_94c6cb80.zip


KE Kathiravan Elangovan Syncfusion Team January 10, 2018 12:04 PM UTC

Hi Marcel, 

We confirm that the reported issue “PDF Viewer control displaying a loading indicator and it could not be load a PDF document in PDF Viewer Windows Forms” is a defect,  the fix for this issue will be included in our upcoming main release 2018 volume 1 release which will be available on February 2018. 

Please let us know if you have any concerns.

Regards, 
Kathiravan E


MW Marcel Wagenaar January 11, 2018 07:21 AM UTC

Ok, thanks for your effort!


MW Marcel Wagenaar replied to Kathiravan Elangovan April 7, 2018 08:13 AM UTC

Hi Marcel, 

We confirm that the reported issue “PDF Viewer control displaying a loading indicator and it could not be load a PDF document in PDF Viewer Windows Forms” is a defect,  the fix for this issue will be included in our upcoming main release 2018 volume 1 release which will be available on February 2018. 

Please let us know if you have any concerns.

Regards, 
Kathiravan E

Hi Kathiravan,

Did you you  my code with the latest release (.32)? Problem not not yet solved....

Regard, Marcel


PE Priyanga Elangovan Syncfusion Team April 9, 2018 12:57 PM UTC

Hi Marcel,

Sorry for the inconvenience caused.

Currently we had not included the fix for the issue “PDF Viewer control displaying a loading indicator and it could not be load a PDF document in PDF Viewer Windows Forms
” in our 2018 Volume 1 SP1 release. We will resolve this issue and include the fix in our 2018 Volume 1 SP2 release which will be available in April, 2018.

Regards,
Priyanga.E
 



MW Marcel Wagenaar replied to Priyanga Elangovan April 30, 2018 05:47 PM UTC

Hi Marcel,

Sorry for the inconvenience caused.

Currently we had not included the fix for the issue “PDF Viewer control displaying a loading indicator and it could not be load a PDF document in PDF Viewer Windows Forms
” in our 2018 Volume 1 SP1 release. We will resolve this issue and include the fix in our 2018 Volume 1 SP2 release which will be available in April, 2018.

Regards,
Priyanga.E
 


Hello,

Problem solved! Thank you!

Kind regards, Marcel


AA Akshaya Arivoli Syncfusion Team May 1, 2018 04:20 AM UTC

Hi Marcel, 

We are glad to hear that the issue is resolved. 

Thanks, 
Akshaya 


Loader.
Up arrow icon