- Code: Select all
spirePdfViewer.LoadFromFile(path, password);
This generally takes around 5 seconds. I would like to have a PictureBox with a loading animation (gif), but the pdfViewer manipulates a Form Control somewhere.
If I load the pdf in a Task or Thread it throws an InvalidOperationException due to spirePdf accessing the control from a thread other than the main UI thread. If I load the pdf in the main UI thread the picture box obviously can’t animate while the load method is running.
Additionally, once loadPdf return there is another 5 second delay before the pdf is actually visible, and the UI is locked during this additional time as well.
Any thoughts on how to resolve this?
Thanks.