{"id":387,"date":"2023-11-09T15:40:50","date_gmt":"2023-11-09T07:40:50","guid":{"rendered":""},"modified":"2025-01-21T15:45:27","modified_gmt":"2025-01-21T07:45:27","slug":"article-slug-320","status":"publish","type":"post","link":"https:\/\/support.fuxinsoft.cn\/?p=387","title":{"rendered":"\u3010Foxit PDF SDK\u3011\u798f\u6615GSDK\u5982\u4f55\u5728\u9875\u9762\u4e2d\u521b\u5efa\u4e00\u4e2a\u6587\u672c\u5bf9\u8c61\uff1f"},"content":{"rendered":"<p style=\"margin-top: 10px; margin-bottom: 0px; padding: 0px; color: rgb(23, 43, 77); font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, Oxygen, Ubuntu, &quot;Fira Sans&quot;, &quot;Droid Sans&quot;, &quot;Helvetica Neue&quot;, sans-serif; text-wrap: wrap; background-color: rgb(255, 255, 255);\">\u8bf7\u53c2\u8003\u4ee5\u4e0b\u4ee3\u7801\uff1a<\/p>\n<p style=\"margin-top: 10px; margin-bottom: 0px; padding: 0px; color: rgb(23, 43, 77); font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, Oxygen, Ubuntu, &quot;Fira Sans&quot;, &quot;Droid Sans&quot;, &quot;Helvetica Neue&quot;, sans-serif; text-wrap: wrap; background-color: rgb(255, 255, 255);\">long position = page.getLastGraphicsObjectPosition(e_TypeText);<\/p>\n<p style=\"margin-top: 10px; margin-bottom: 0px; padding: 0px; color: rgb(23, 43, 77); font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, Oxygen, Ubuntu, &quot;Fira Sans&quot;, &quot;Droid Sans&quot;, &quot;Helvetica Neue&quot;, sans-serif; text-wrap: wrap; background-color: rgb(255, 255, 255);\">TextObject text_object = TextObject.create();<\/p>\n<p style=\"margin-top: 10px; margin-bottom: 0px; padding: 0px; color: rgb(23, 43, 77); font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, Oxygen, Ubuntu, &quot;Fira Sans&quot;, &quot;Droid Sans&quot;, &quot;Helvetica Neue&quot;, sans-serif; text-wrap: wrap; background-color: rgb(255, 255, 255);\">text_object.setFillColor(0xFFFF7F00);<\/p>\n<p style=\"margin-top: 10px; margin-bottom: 0px; padding: 0px; color: rgb(23, 43, 77); font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, Oxygen, Ubuntu, &quot;Fira Sans&quot;, &quot;Droid Sans&quot;, &quot;Helvetica Neue&quot;, sans-serif; text-wrap: wrap; background-color: rgb(255, 255, 255);\">\/\/ \u521b\u5efa text state\u5bf9\u8c61\u3002<\/p>\n<p style=\"margin-top: 10px; margin-bottom: 0px; padding: 0px; color: rgb(23, 43, 77); font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, Oxygen, Ubuntu, &quot;Fira Sans&quot;, &quot;Droid Sans&quot;, &quot;Helvetica Neue&quot;, sans-serif; text-wrap: wrap; background-color: rgb(255, 255, 255);\">TextState state = new TextState();<\/p>\n<p style=\"margin-top: 10px; margin-bottom: 0px; padding: 0px; color: rgb(23, 43, 77); font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, Oxygen, Ubuntu, &quot;Fira Sans&quot;, &quot;Droid Sans&quot;, &quot;Helvetica Neue&quot;, sans-serif; text-wrap: wrap; background-color: rgb(255, 255, 255);\">state.setFont_size(80.0f);<\/p>\n<p style=\"margin-top: 10px; margin-bottom: 0px; padding: 0px; color: rgb(23, 43, 77); font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, Oxygen, Ubuntu, &quot;Fira Sans&quot;, &quot;Droid Sans&quot;, &quot;Helvetica Neue&quot;, sans-serif; text-wrap: wrap; background-color: rgb(255, 255, 255);\">state.setFont(new Font(&quot;Simsun&quot;, e_StylesSmallCap, e_CharsetGB2312, 0));<\/p>\n<p style=\"margin-top: 10px; margin-bottom: 0px; padding: 0px; color: rgb(23, 43, 77); font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, Oxygen, Ubuntu, &quot;Fira Sans&quot;, &quot;Droid Sans&quot;, &quot;Helvetica Neue&quot;, sans-serif; text-wrap: wrap; background-color: rgb(255, 255, 255);\">state.setTextmode(e_ModeFill);<\/p>\n<p style=\"margin-top: 10px; margin-bottom: 0px; padding: 0px; color: rgb(23, 43, 77); font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, Oxygen, Ubuntu, &quot;Fira Sans&quot;, &quot;Droid Sans&quot;, &quot;Helvetica Neue&quot;, sans-serif; text-wrap: wrap; background-color: rgb(255, 255, 255);\">text_object.setTextState(page, state, false, 750);<\/p>\n<p style=\"margin-top: 10px; margin-bottom: 0px; padding: 0px; color: rgb(23, 43, 77); font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, Oxygen, Ubuntu, &quot;Fira Sans&quot;, &quot;Droid Sans&quot;, &quot;Helvetica Neue&quot;, sans-serif; text-wrap: wrap; background-color: rgb(255, 255, 255);\">\/\/\u8bbe\u7f6e\u6587\u672c\u3002<\/p>\n<p style=\"margin-top: 10px; margin-bottom: 0px; padding: 0px; color: rgb(23, 43, 77); font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, Oxygen, Ubuntu, &quot;Fira Sans&quot;, &quot;Droid Sans&quot;, &quot;Helvetica Neue&quot;, sans-serif; text-wrap: wrap; background-color: rgb(255, 255, 255);\">text_object.setText(&quot;Foxit Software&quot;);<\/p>\n<p style=\"margin-top: 10px; margin-bottom: 0px; padding: 0px; color: rgb(23, 43, 77); font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, Oxygen, Ubuntu, &quot;Fira Sans&quot;, &quot;Droid Sans&quot;, &quot;Helvetica Neue&quot;, sans-serif; text-wrap: wrap; background-color: rgb(255, 255, 255);\">long last_position = page.insertGraphicsObject(position, text_object);<\/p>\n<p style=\"margin-top: 10px; margin-bottom: 0px; padding: 0px; color: rgb(23, 43, 77); font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, Oxygen, Ubuntu, &quot;Fira Sans&quot;, &quot;Droid Sans&quot;, &quot;Helvetica Neue&quot;, sans-serif; text-wrap: wrap; background-color: rgb(255, 255, 255);\">RectF rect = text_object.getRect();<\/p>\n<p style=\"margin-top: 10px; margin-bottom: 0px; padding: 0px; color: rgb(23, 43, 77); font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, Oxygen, Ubuntu, &quot;Fira Sans&quot;, &quot;Droid Sans&quot;, &quot;Helvetica Neue&quot;, sans-serif; text-wrap: wrap; background-color: rgb(255, 255, 255);\">float offset_x = (page.getWidth() &#8211; (rect.getRight() &#8211; rect.getLeft())) \/ 2;<\/p>\n<p style=\"margin-top: 10px; margin-bottom: 0px; padding: 0px; color: rgb(23, 43, 77); font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, Oxygen, Ubuntu, &quot;Fira Sans&quot;, &quot;Droid Sans&quot;, &quot;Helvetica Neue&quot;, sans-serif; text-wrap: wrap; background-color: rgb(255, 255, 255);\">float offset_y = page.getHeight() * 0.8f &#8211; (rect.getTop() &#8211; rect.getBottom()) \/ 2;<\/p>\n<p style=\"margin-top: 10px; margin-bottom: 0px; padding: 0px; color: rgb(23, 43, 77); font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, Oxygen, Ubuntu, &quot;Fira Sans&quot;, &quot;Droid Sans&quot;, &quot;Helvetica Neue&quot;, sans-serif; text-wrap: wrap; background-color: rgb(255, 255, 255);\">text_object.transform(new Matrix2D(1, 0, 0, 1, offset_x, offset_y), false);<\/p>\n<p style=\"margin-top: 10px; margin-bottom: 0px; padding: 0px; color: rgb(23, 43, 77); font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, Oxygen, Ubuntu, &quot;Fira Sans&quot;, &quot;Droid Sans&quot;, &quot;Helvetica Neue&quot;, sans-serif; text-wrap: wrap; background-color: rgb(255, 255, 255);\">\/\/\u751f\u6210\u5185\u5bb9\u3002<\/p>\n<p style=\"margin-top: 10px; margin-bottom: 0px; padding: 0px; color: rgb(23, 43, 77); font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, Oxygen, Ubuntu, &quot;Fira Sans&quot;, &quot;Droid Sans&quot;, &quot;Helvetica Neue&quot;, sans-serif; text-wrap: wrap; background-color: rgb(255, 255, 255);\">page.generateContent();<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8bf7\u53c2\u8003\u4ee5\u4e0b\u4ee3\u7801\uff1a long position = page.getLastGraphicsObjectPosi [&hellip;]<\/p>\n","protected":false},"author":11,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[77],"tags":[],"class_list":["post-387","post","type-post","status-publish","format-standard","hentry","category-gsdk"],"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\/387","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=387"}],"version-history":[{"count":1,"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=\/wp\/v2\/posts\/387\/revisions"}],"predecessor-version":[{"id":4217,"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=\/wp\/v2\/posts\/387\/revisions\/4217"}],"wp:attachment":[{"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=387"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=387"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=387"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}