跳到内容
  • 福昕首页
  • 开发中心
  • SDK文档资料
  • 福昕首页
  • 开发中心
  • SDK文档资料
申请试用
  • 企业自动化
    • Compressor
  • 福昕CloudAPI
  • 福昕PDF SDK 软件开发工具包
    • 福昕PDF SDK(ActiveX)
    • 福昕PDF SDK(桌面/服务器)
    • 福昕PDF SDK(Plug-in)
    • 福昕 PDF SDK(安卓)
    • 福昕PDF SDK(iOS)
    • 福昕PDF SDK(Web)
  • 福昕管理控制台
    • 公有云
    • 私有云
    • 通用情况
  • 福昕阅读器
    • RMS插件
  • 福昕高级编辑器
    • AI助手
    • Mac版本
      • 常规问题
    • windows版本
      • ECM集成
      • 互联PDF
      • 企业管理指南
      • 保护
      • 内容编辑
      • 创建PDF
      • 压缩
      • 图章
      • 安装与卸载
      • 常见问题
      • 打印
      • 注释/评论
      • 福昕插件
      • 翻译助手
      • 翻译助手教程
      • 试用与激活
      • 转换
      • 页面管理
    • 教育用户
      • 论文查重
      • 论文畅
    • 网页版
      • 电子签章
    • 订阅
    • 资源
  • 福昕高级编辑器Linux版本
  • 福船图纸管理系统
  • 福昕PDF SDK 软件开发工具包
  • 标签:

【Foxit PDF SDK】如何对图形对象进行中心旋转

  • 福昕知识库
  • 2023-06-02

在PDF标准中,“旋转PDF页面中的图形对象”是指默认以PDF页面坐标原点(即PDF页面左下角)为基准的旋转图形对象。

但在实际应用场景中,有些用户会希望以图形对象为中心进行旋转。示例代码如下:

RectF org_rect = graphics_obj.GetRect();

PointF org_centre_point = new PointF();

org_centre_point.x = org_rect.left + org_rect.Width() / 2;

org_centre_point.y = org_rect.bottom + org_rect.Height() / 2;

// Calculate the matrix which is used to transform image object to be rotated with its own centre.

Matrix2D matrix = new Matrix2D();

const float PI = 3.14f;

float radian = PI / 2; // Equals to 90 degrees (in angle).

// Matrix2D::Rotate will do the rotation in counter-clockwise

// and based on the origin point of PDF coordinate -- that means the lower-left corner of the page.

matrix.Rotate(radian, false);

// After being rotated, the "centre" point should be moved back to the original centre position for this case.

float temp_x = org_centre_point.x;

float temp_y = org_centre_point.y;

matrix.TransformPoint(ref temp_x, ref temp_y);

matrix.Translate(org_centre_point.x - temp_x, org_centre_point.y - temp_y, false);

graphics_obj.Transform(matrix, false);

// # Related PDF page should generate content

page.GenerateContent();

... // If to render PDF page then, please re-parse PDF page. Please refer to comment of PDFPage::GenerateContent in API reference for more details.

相关内容

【校园昕积分】邀请攻略:使用福昕合作高校发放教育专用激活码激活

【校园昕积分】邀请攻略:使用CARSI高校账户或高校EDU邮箱注册

在福昕高级PDF编辑器中如何自定义快速访问工具栏

在福昕高级PDF编辑器中如何设置常用图章

在对文件虚拟打印后如何设置文件不自动打开

通知消息关闭后如何开启

PDF文件奇偶页差异化页码添加

Web SDK 开发实战:动态自定义 PDF 注释右键菜单的 JavaScript 实现方案

无法安装服务“Foxit Document Management”(FoxitAssistantSvcPlus)

将3D文件添加作为信任文件

推荐内容

【校园昕积分】邀请攻略:使用福昕合作高校发放教育专用激活码激活

【校园昕积分】邀请攻略:使用CARSI高校账户或高校EDU邮箱注册

在福昕高级PDF编辑器中如何自定义快速访问工具栏

在福昕高级PDF编辑器中如何设置常用图章

在对文件虚拟打印后如何设置文件不自动打开

通知消息关闭后如何开启

PDF文件奇偶页差异化页码添加

Web SDK 开发实战:动态自定义 PDF 注释右键菜单的 JavaScript 实现方案

无法安装服务“Foxit Document Management”(FoxitAssistantSvcPlus)

将3D文件添加作为信任文件

产品
  • 应用行业
  • 白皮书
开发支持
  • 开发中心
  • SDK文档资料

销售咨询:010-50951668

客服电话:0591-38509808

销售咨询
微信公众号

©2025 福建福昕软件开发股份有限公司 版权所有

隐私策略