我设法旋转了文档中的各个页面,但我无法获得任何刷新页面的方法。我必须重新导航到页面才能看到旋转的效果。对于我们的用户来说,这不是理想的情况。
MyPDF查看代码:
public void RotatePage(int page)
{
Page.Rotate originalRotation = m_PdfDocument.GetPage(page).GetRotation();
Page.Rotate rotation;
switch (originalRotation)
{
case Page.Rotate.e_0: rotation = Page.Rotate.e_90; break;
case Page.Rotate.e_90: rotation = Page.Rotate.e_180; break;
case Page.Rotate.e_180: rotation = Page.Rotate.e_270; break;
case Page.Rotate.e_270: rotation = Page.Rotate.e_0; break;
default: rotation = Page.Rotate.e_0; break;
}
m_PdfDocument.GetPage(page).SetRotation(rotation);
}
frm主要代码:
private void btnTurnView_ItemClick(object sender, ItemClickEventArgs e)
{
if (CurrentForm != null)
{
CurrentForm.p_m_oPDFViewCtrl.RotatePage(CurrentForm.p_m_oPDFViewCtrl.p_PageInfo.p_PageNumber);
}
}
到目前为止我尝试过的事情:文档/视图的不同部分上的 Invalidate()、Refresh()、Update()。我可以运行页面分析(类似于页面更改时发生的情况),这可能会解决问题,但会带来不必要的开销,如果有更有效的方法,我宁愿依赖它。