嘗試用itext7做PDF文件整合工作,縮放文件後匯出檔案,某些頁面會自動向右旋轉90度
以下為程式碼
PdfPage page = pdfDocument.GetPage(i);
PdfFormXObject formXObject = page.CopyAsFormXObject(outPDfDoc);
Single xPercent = PageSize.B5.GetWidth() / page.GetPageSize().GetWidth();
Single yPercent = PageSize.B5.GetHeight() / page.GetPageSize().GetHeight();
PdfCanvas pdfCanvas = new PdfCanvas(outPDfDoc.AddNewPage());
pdfCanvas.AddXObjectWithTransformationMatrix(formXObject, xPercent, 0, 0, yPercent, 0, 0);
想請問如何避免此情況