Rearrange pages in PdfViewer via drag and drop
Hi,
I really like the PdfViewer control and how easy it is to display pdf files. However, I'd like to allow the users to visually arrange displayed pages via drag and drop. Is this feature included in the SfPdfViewer control?
If not, it'd be better to create a List<Image> out of the pdf file and render that in a ListView. Therefore, I would be able to fully customize the pages' item template. How could this be achieved without loading the file in a dummy SfPdfViewer first and call GetPages() afterwards?
Thanks and regards,
Sebastian
SIGN IN To post a reply.
3 Replies
NK
Navaneetha Kannan Sudalai Muthu
Syncfusion Team
May 3, 2018 02:49 PM UTC
Hi Sebastian,
At present, PdfViewer does not support rearranging the pages of PDF. We have prepared a sample to load the PDF pages in a ListView and rearrange their order without using PdfViewer as you requested. Please find the sample in the link below.
However, we made use of Syncfusion’s PdfLoadedDocument to save the rearranged PDF. The rearranged file will be saved in the Application’s local folder.
Please let us know if you need any further assistance.
Best,
Navaneetha Kannan
SE
Sebastian
May 5, 2018 04:11 PM UTC
Thank you for the answer and the sample.
Unfortunately, the process of rendering every individual page as an image beforehand (!) is very slow and memory intensive. Maybe the PdfViewer is still the way to go? Is there a "base class" of the pdf rendering engine which could be used to show an individual page and could be put into a Listview?
Or do you have another idea to somehow virtualize the image rendering?
NK
Navaneetha Kannan Sudalai Muthu
Syncfusion Team
May 7, 2018 11:19 AM UTC
Hi Sebastian,
There is no base class of PdfViewer’s rendering engine available. But it is possible to increase loading speed by updating the ListView items progressively as mentioned in the MSDN documentation below.
We have achieved the same in the previously updated sample. The modified sample can be downloaded from the link below.
In the previously updated sample the pages will not appear for several minutes for a 55 pages PDF. But now in the attached sample first few pages will appear immediately, and the rest of the pages will be updated progressively in a seamless way.
Please find more UI virtualization concepts in the documentation links below.
https://docs.microsoft.com/en-us/windows/uwp/debug-test-perf/listview-and-gridview-data-optimization
Best,
Navaneetha Kannan
SIGN IN To post a reply.
- 3 Replies
- 2 Participants
-
SE Sebastian
- May 2, 2018 09:44 AM UTC
- May 7, 2018 11:19 AM UTC