Rotating PDF in C# using iTextSharp

后端 未结 5 1194
野的像风
野的像风 2020-12-08 17:04

I am using the below function to split the pdf into two.

Though it is spliting the pdf, the content is appearing upside down. How do I rotate it by 180 degrees.

5条回答
  •  鱼传尺愫
    2020-12-08 17:26

    A little change in above code old code

    case 270:
        writer.DirectContent.AddTemplate(importedPage, 0, 1f, -1f, 0, pageWidth, 0);
    

    new code

    case 270:
        writer.DirectContent.AddTemplate(importedPage, 0, 1f, -1f, 0, pageHeight, 0);
    

    This will fix the issue with 270 degree rotation

提交回复
热议问题