string sourcePdfPath = @"F:\SplitPDF\SplitPDF\Main File\pdffile.pdf"; string outputPdfPath = @"F:\SplitPDF\SplitPDF\Main File\"; string pages = txtpagenumbers.Text; int[] extractThesePages = pages.Split(',').Select(n => Convert.ToInt32(n)).ToArray(); Document pdfDocument = new Document(sourcePdfPath); int pageCount = pdfDocument.Pages.Count; Document newDocument = new Document(); foreach (int i in extractThesePages) { Page pdfPage = pdfDocument.Pages[i]; newDocument.Pages.Add(pdfPage); } generatepassword(); string fname = "page_"+randfilenu+"_"+DateTime.Now.ToShortDateString()+".pdf"; newDocument.Save(outputPdfPath + fname ); MessageBox.Show("Splitted File has been Created and saved to folder: \n" + outputPdfPath + fname);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)