Can a PDF reader create a list-details look?

Image_8667_1703829129035

This is a representation. As you can see, the left side is the page list of a single PDF file, and the right side is a page you selected.



Attachment: PdfViewer_1126160908__2_eafc008a.zip

17 Replies

MA ManojKumar Arumugasamy Syncfusion Team January 2, 2024 05:24 AM UTC

Hi Shompinice,

We can create a custom thumbnail view using our exporting page as image concept. Please find our below UG documentation link for your reference,

 

UG Link:  https://help.syncfusion.com/uwp/pdf-viewer/concepts-and-features/exporting-pages-as-image

 

Based on your requirement, we have prepared a simple sample using the “exporting page as image concept." Please look into the sample for reference, and you can integrate that logic into your sample.

Sample link:

https://www.syncfusion.com/downloads/support/directtrac/general/ze/ThumbnailSample200939276



SH Shompinice replied to ManojKumar Arumugasamy January 5, 2024 04:47 AM UTC

Program crashes when clicking on a thumbnail



SH Shompinice replied to ManojKumar Arumugasamy January 7, 2024 02:36 PM UTC

In your example, list and detail scrolling cannot be synchronized. In other words, when the right page is scrolled, the selected page on the left should simultaneously change to the "right current page".


I initially thought Syncfusion's PDF View control couldn't do it, but I searched for this


https://support.syncfusion.com/kb/article/7049/how-to-scroll-to-a-pspecial-vertical-offset-in-the-pdf-viewer-uwp-programmatically


But I'm having trouble putting it all together.


Is it possible to modify the current example to ensure that when scrolling the right page, the page selected on the left should also be modified to "the current page on the right"?



MA ManojKumar Arumugasamy Syncfusion Team January 8, 2024 09:41 AM UTC

Hi Shompinice,

Kindly find the modified sample, we have synced the Thumbnail images with the PDF viewer pages
Sample link: https://www.syncfusion.com/downloads/support/directtrac/general/ze/ThumbnailSample-1464088731  



SH Shompinice replied to ManojKumar Arumugasamy January 9, 2024 12:41 AM UTC

Our developer came up with the idea of using a Syncfusion PDF Viewer control directly on the left side to shrink it to a very small size (for example, 10% of the current window).


When the right side scrolls, the current height is passed to the left side, so that the corresponding position on the left side is highlighted.


Is this idea feasible? In other words, Syncfusion PDF Viewer does not have a minimum width limit or anything like that, right?



MA ManojKumar Arumugasamy Syncfusion Team January 9, 2024 09:33 AM UTC

Hi Shompinice,

Syncfusion PDFViewer control does not have a minimum width and can be sized to below 10% of the current window. But for list thumbnail view, it will not be an easy option; you need to load PDFs for both viewers, and you need to sync the pages using more events than the events in the provided sample. Kindly check the previously provided sample that we have provided; it has a separate view to the thumbnails, and we have synced the pages in the right view and left view. Kindly test the sample and let us know if it satisfies your requirements.


You can also try using the default thumbnail view that is visible when viewer is loaded with PDF and fully zoomed out. This thumbnail is a grid view.



SH Shompinice replied to ManojKumar Arumugasamy January 10, 2024 10:23 AM UTC

好吧,失败成功了。我们的开发人员(又名我的好朋友)无法将您提供的示例集成到现有代码中。你们可以修改我在这里上传的示例来展示如何显示缩略图吗?(您可以添加一个按钮,按下一次即可启用缩略图,再次按下则关闭,就像汉堡菜单一样。此外,默认情况下启用左侧的缩略图。)



MA ManojKumar Arumugasamy Syncfusion Team January 11, 2024 11:21 AM UTC

Hi Shompinice,

As we mentioned earlier, you can export the pages as images using the DocumentLoaded event callback method. To synchronize the list item and pdf viewer pages, you can use the PageChange event callback method. Also, you can use a similar approach to the bookmark toolbar in your sample to have thumbnails on the grid view. Kindly refer to the provided sample.

We apologize, but we can only provide a sample to fulfil your request. Kindly incorporate our sample into yours to suit your demands.



SH Shompinice replied to ManojKumar Arumugasamy January 21, 2024 10:17 AM UTC

我已经成功地将预览图像合并到其中。但我遇到了一个新问题


它似乎一直在崩溃

有时在调整窗口大小时崩溃,有时在切换页面时崩溃。


此外,它总是在显示预览之前加载所有页面。如果页面很多,左侧的预览将需要很长时间才能加载。

图片_3810_1705816613852

图片_5071_1705816599381



附件:PdfViewer_1126160908__4_19ad1d48.zip 


Attachment: PdfViewer_1126160908__4_30b9db18.zip


SH Shompinice replied to Shompinice January 22, 2024 09:04 AM UTC

Add a console output and my modified code


Attachment: PdfViewer_1126160908__5_3b4186d9.zip


MA ManojKumar Arumugasamy Syncfusion Team January 22, 2024 01:15 PM UTC

Hi Shompinice,

We were unable to reproduce the issue, “PdfViewer crashes with exception while resizing and changing pages,” and it is working as expected. Could you please check the replication video and let us know whether we have missed anything while replicating the issue? We suspect that loading certain PDFs might cause this issue. Also,  if possible, kindly let us know the exact scenario in which this issue occurs and provide us with the PDF document that might cause the issue.

  

Please find the replication video at the below link.

https://www.syncfusion.com/downloads/support/directtrac/general/ze/186061VideoRecording611918186

 

For larger documents it will take some time with respect to the number of pages on the PDF once loading is completed it will not load again to the list view.



SH Shompinice replied to ManojKumar Arumugasamy January 22, 2024 01:29 PM UTC

==================


Exception


Destination array was not long enough. Check the destination index, length, and the array's lower bounds.

Parameter name: destinationArray


   at System.Array.Copy(Array sourceArray, Int32 sourceIndex, Array destinationArray, Int32 destinationIndex, Int32 length, Boolean reliable)

   at System.Collections.Generic.List`1.CopyTo(T[] array, Int32 arrayIndex)

   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)

   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)

   at Syncfusion.Windows.PdfViewer.PdfDocumentView.CreateTextSelectionEnvironment(Int32 pageNumber)

   at Syncfusion.Windows.PdfViewer.PdfDocumentView.<m_dispatcherTimer_Tick>d__425.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

   at System.Threading.WinRTSynchronizationContextBase.Invoker.InvokeCore()




SH Shompinice replied to ManojKumar Arumugasamy January 22, 2024 01:33 PM UTC

Try loading this 165 page document or other document with very large page count (e.g. 150+ pages)


Then change the window size, and change the zoom mode (fill the window size, or fit the window size) to randomly jump to the following page, change the zoom again and again, repeat the above process over and over again - change the page a few times, change the zoom a few times, change a few times page, change the zoom several times.




Attachment: 165PagePDF_d2bed752.zip


SH Shompinice replied to ManojKumar Arumugasamy January 22, 2024 01:47 PM UTC

This is an interrupted video, please note that an exception was thrown in the video.


Attachment: ScreenVideo_20240122_214253_a35e21d6.zip


MA ManojKumar Arumugasamy Syncfusion Team January 23, 2024 04:00 PM UTC

Hi Shompinice,

We were rarely able to catch the exception, but it did not interfere with the normal function of the application. Also, the exception is handled and does not crash the application. Could you please try testing the application in release mode and let us know whether you have any exceptions while running the application?



SH Shompinice replied to ManojKumar Arumugasamy January 24, 2024 03:44 AM UTC

Yes, exceptions exist in release mode. Additionally, it will cause the app to crash.


Whether developers or users, it is obviously unacceptable for an application to crash once within four minutes.


Our developer is leaning toward the issue coming from the Syncfusion PDF Viewer framework rather than our code, and asked me to attach the report for your review.


In the above replies, I have attached videos, source code compressed packages, complete console output, key contents of the console output, and PDF files that caused exceptions in my tests, a total of five contents.



MA ManojKumar Arumugasamy Syncfusion Team January 25, 2024 11:02 AM UTC

We were unable to replicate the issue on release mode we tried to replicate the issue for more than 5 minutes but were unable to produce an exception or crash on the application. We have attached a video for your reference.


Attachment: Recording_ab37de6d.zip

Loader.
Up arrow icon