2
// Create a new PDF document
PdfDocument pdfDoc = new PdfDocument();
// Read the first 2 pages of the existing PDF file
PdfDocument existingPdf = new PdfDocument("existing_file.pdf");
PdfPage firstPage = existingPdf.Pages[0];
PdfPage secondPage = existingPdf.Pages[1];
// Add the first page to the new PDF document
pdfDoc.Pages.Add(firstPage);
// Add the second page to the new PDF document, scaled and rotated to fit the page
PdfPage newPage = pdfDoc.AddPage();
PdfPageSize pageSize = newPage.Size;
PdfPageRotation pageRotation = newPage.Rotation;
PdfPageOrientation pageOrientation = newPage.Orientation;
PdfRectangle secondPageRect = new PdfRectangle(0, 0, pageSize.Width / 2, pageSize.Height);
PdfGraphics g = newPage.Graphics;
g.Save();
g.TranslateTransform(pageSize.Width / 2, 0);
g.ScaleTransform(0.5f, 1);
g.RotateTransform(90);
g.DrawImage(secondPage.CreateFormXObject(secondPageRect), secondPageRect);
g.Restore();
// Save the new PDF document
pdfDoc.Save("new_file.pdf");
// Close the new and existing PDF documents
pdfDoc.Close();
existingPdf.Close();

1
You can use the PDFFile class to combine the PDF pages and edit the look of the page. Here is some code you can build on:
PDFFile file = new PDFFile(@"C:\inputfolder\input.pdf");
for (int i = 1; i <= file.GetPageCount(); i++)
{
string destinationFileName = Path.Combine(@"C:\inputfolder", string.Format("Page{0}.pdf", i));
file.ExtractPages(i, i, destinationFileName); // extract different pages to pdf
}
file.ExtractPages(1, 2, @"C:\outputfolder\output.pdf"); // Copy over pages 1-2 to make the new pdf
https://www.leadtools.com/help/sdk/v22/dh/pdf/pdffile-extractpages.html
https://www.leadtools.com/help/sdk/v22/tutorials/dotnet-winforms-merge-pdf-files-to-single-pdf-file.html
1
Using HIQPDF how to use graphics to create booklet view pdf from existing pdf ?
Below code is not working
PdfGraphics g = newPage.Graphics;
g.Save();
g.TranslateTransform(pageSize.Width / 2, 0);
g.ScaleTransform(0.5f, 1); g.RotateTransform(90);
g.DrawImage(secondPage.CreateFormXObject(secondPageRect), secondPageRect);
g.Restore();