Page truncate in right side for landscape orientation with trimmargins using PdfSharp

前端 未结 3 1746
忘掉有多难
忘掉有多难 2021-01-14 07:18

I am talking about PdfSharp. Portrait orientation works well with margin or without margin. But In case of landscape orientation, page truncate in right side once I set any

3条回答
  •  佛祖请我去吃肉
    2021-01-14 07:42

    I had this same problem -- very frustrating. To anyone whom the top solution didn't work: try this!

    Since PDFSharp can only handle graphics and transformations properly on pages in portrait orientation, my work-around on my project was converting the landscape pages to portrait with .page.Rotate = 0 upon input. Remember that these files are now sideways so keep that in mind when applying graphics and transformations. Then before saving the file, I converted the page back to landscape with .page.Rotate = 90. Worked fine for me! Good luck y'all.

提交回复
热议问题