User Change PDF page order.

1 Answer 70 Views
PdfViewer and PdfViewerNavigator
Adan
Top achievements
Rank 2
Adan asked on 12 Apr 2023, 05:24 PM

Hi.

How can a user change a PDF page order within radPdfViewer or radPdfViewerNavigator or another tool? 

What would be the behindcode for it?

Thanks.

 

1 Answer, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 14 Apr 2023, 07:43 AM

Hi Adan,

To achieve this you should use the PdfProcessing library. With it, you can import the document and use the Pages collection to change the order. Here is an example:

var provider = new PdfFormatProvider();
var document = provider.Import(File.ReadAllBytes(@"..\..\..\lorem_large.pdf"));

var page = document.Pages.Last();
document.Pages.Remove(page);
document.Pages.Insert(0, page);

I hope this helps. Should you have any other questions do not hesitate to ask.

Regards,
Dimitar
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
PdfViewer and PdfViewerNavigator
Asked by
Adan
Top achievements
Rank 2
Answers by
Dimitar
Telerik team
Share this question
or