{"id":210,"date":"2023-06-02T15:15:50","date_gmt":"2023-06-02T07:15:50","guid":{"rendered":""},"modified":"2023-06-02T15:15:50","modified_gmt":"2023-06-02T07:15:50","slug":"article-slug","status":"publish","type":"post","link":"https:\/\/support.fuxinsoft.cn\/?p=210","title":{"rendered":"\u3010Foxit PDF SDK\u3011\u5982\u4f55\u5bf9\u56fe\u5f62\u5bf9\u8c61\u8fdb\u884c\u4e2d\u5fc3\u65cb\u8f6c"},"content":{"rendered":"<p><span style=\"font-family:\u7b49\u7ebf\">\u5728<\/span>PDF<span style=\"font-family:\u7b49\u7ebf\">\u6807\u51c6\u4e2d\uff0c\u201c\u65cb\u8f6c<\/span>PDF<span style=\"font-family:\u7b49\u7ebf\">\u9875\u9762\u4e2d\u7684\u56fe\u5f62\u5bf9\u8c61\u201d\u662f\u6307\u9ed8\u8ba4\u4ee5<\/span>PDF<span style=\"font-family:\u7b49\u7ebf\">\u9875\u9762\u5750\u6807\u539f\u70b9\uff08\u5373<\/span>PDF<span style=\"font-family:\u7b49\u7ebf\">\u9875\u9762\u5de6\u4e0b\u89d2\uff09\u4e3a\u57fa\u51c6\u7684\u65cb\u8f6c\u56fe\u5f62\u5bf9\u8c61\u3002<\/span><\/p>\n<p><span style=\"font-family:\u7b49\u7ebf\">\u4f46\u5728\u5b9e\u9645\u5e94\u7528\u573a\u666f\u4e2d\uff0c\u6709\u4e9b\u7528\u6237\u4f1a\u5e0c\u671b\u4ee5\u56fe\u5f62\u5bf9\u8c61\u4e3a\u4e2d\u5fc3\u8fdb\u884c\u65cb\u8f6c\u3002\u793a\u4f8b\u4ee3\u7801\u5982\u4e0b\uff1a<\/span><\/p>\n<p>RectF org_rect = graphics_obj.GetRect();<\/p>\n<p>PointF org_centre_point = new PointF();<\/p>\n<p>org_centre_point.x = org_rect.left + org_rect.Width() \/ 2;<\/p>\n<p>org_centre_point.y = org_rect.bottom + org_rect.Height() \/ 2;<\/p>\n<p>\/\/ Calculate the matrix which is used to transform image object to be rotated with its own centre.<\/p>\n<p>Matrix2D matrix = new Matrix2D();<\/p>\n<p>const float PI = 3.14f;<\/p>\n<p>float radian = PI \/ 2; \/\/ Equals to 90 degrees (in angle).<\/p>\n<p>\/\/ Matrix2D::Rotate will do the rotation in counter-clockwise<\/p>\n<p>\/\/ and based on the origin point of PDF coordinate &#8212; that means the lower-left corner of the page.<\/p>\n<p>matrix.Rotate(radian, false);<\/p>\n<p>\/\/ After being rotated, the &quot;centre&quot; point should be moved back to the original centre position for this case.<\/p>\n<p>float temp_x = org_centre_point.x;<\/p>\n<p>float temp_y = org_centre_point.y;<\/p>\n<p>matrix.TransformPoint(ref temp_x, ref temp_y);<\/p>\n<p>matrix.Translate(org_centre_point.x &#8211; temp_x, org_centre_point.y &#8211; temp_y, false);<\/p>\n<p>graphics_obj.Transform(matrix, false);<\/p>\n<p>\/\/ # Related PDF page should generate content<\/p>\n<p>page.GenerateContent();<\/p>\n<p>&#8230; \/\/ If to render PDF page then, please re-parse PDF page. Please refer to comment of PDFPage::GenerateContent in API reference for more details.<\/p>\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728PDF\u6807\u51c6\u4e2d\uff0c\u201c\u65cb\u8f6cPDF\u9875\u9762\u4e2d\u7684\u56fe\u5f62\u5bf9\u8c61\u201d\u662f\u6307\u9ed8\u8ba4\u4ee5PDF\u9875\u9762\u5750\u6807\u539f\u70b9\uff08\u5373PDF\u9875\u9762\u5de6\u4e0b\u89d2\uff09\u4e3a\u57fa\u51c6\u7684\u65cb\u8f6c\u56fe [&hellip;]<\/p>\n","protected":false},"author":11,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[38],"tags":[],"class_list":["post-210","post","type-post","status-publish","format-standard","hentry","category-software-development-kit"],"pp_statuses_selecting_workflow":false,"pp_workflow_action":"current","pp_status_selection":"publish","_links":{"self":[{"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=\/wp\/v2\/posts\/210","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=210"}],"version-history":[{"count":0,"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=\/wp\/v2\/posts\/210\/revisions"}],"wp:attachment":[{"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=210"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=210"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=210"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}