{"id":388,"date":"2023-11-09T15:41:29","date_gmt":"2023-11-09T07:41:29","guid":{"rendered":""},"modified":"2025-01-21T15:45:33","modified_gmt":"2025-01-21T07:45:33","slug":"article-slug-321","status":"publish","type":"post","link":"https:\/\/support.fuxinsoft.cn\/?p=388","title":{"rendered":"\u3010Foxit PDF SDK\u3011\u798f\u6615GSDK\u5982\u4f55\u5411PDF\u9875\u9762\u4e2d\u63d2\u5165\u4e00\u4e2a\u56fe\u7247\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_TypeImage);<\/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);\">Image image = new Image(image_file);<\/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);\">ImageObject image_object = ImageObject.create(page.getDocument());<\/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);\">image_object.setImage(image, 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);\">float width = image.getWidth();<\/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 height = image.getHeight();<\/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 page_width = page.getWidth();<\/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 page_height = page.getHeight();<\/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);\">\/\/\u8bf7\u6ce8\u610f\u77e9\u9635\u503c\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);\">image_object.setMatrix(new Matrix2D(width, 0, 0, height, (page_width &#8211; width) \/ 2.0f, (page_height &#8211; height) \/<\/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);\">2.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);\">page.insertGraphicsObject(position, image_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);\">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-388","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\/388","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=388"}],"version-history":[{"count":1,"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=\/wp\/v2\/posts\/388\/revisions"}],"predecessor-version":[{"id":4218,"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=\/wp\/v2\/posts\/388\/revisions\/4218"}],"wp:attachment":[{"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=388"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=388"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=388"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}