我正在使用下面的功能把pdf分解成两个.
虽然它是分割的pdf,内容正在颠倒.如何将其旋转180度.
请帮忙.下面是代码相同
private static void ExtractPages(string inputFile,string outputFile,int start,int end) { // get input document PdfReader inputPdf = new PdfReader(inputFile); // retrieve the total number of pages int pageCount = inputPdf.NumberOfPages; if (end < start || end > pageCount) { end = pageCount; } // load the input document Document inputDoc = new Document(inputPdf.GetPageSizeWithRotation(1)); // create the filestream using (FileStream fs = new FileStream(outputFile,FileMode.Create)) { // create the output writer PdfWriter outputWriter = PdfWriter.GetInstance(inputDoc,fs); inputDoc.Open(); PdfContentByte cb1 = outputWriter.DirectContent; // copy pages from input to output document for (int i = start; i <= end; i++) { inputDoc.SetPageSize(inputPdf.GetPageSizeWithRotation(1)); inputDoc.NewPage(); PdfImportedPage page = outputWriter.GetImportedPage(inputPdf,i); int rotation = inputPdf.GetPageRotation(i); if (rotation == 90 || rotation == 270) { cb1.AddTemplate(page,-1f,1f,inputPdf.GetPageSizeWithRotation(i).Height); } else { cb1.AddTemplate(page,0); } } inputDoc.Close(); } }