{"id":374,"date":"2023-11-09T15:07:07","date_gmt":"2023-11-09T07:07:07","guid":{"rendered":""},"modified":"2023-11-09T15:07:07","modified_gmt":"2023-11-09T07:07:07","slug":"article-slug","status":"publish","type":"post","link":"https:\/\/support.fuxinsoft.cn\/?p=374","title":{"rendered":"\u3010Foxit PDF SDK\u3011\u798f\u6615GSDK\u5982\u4f55\u5c06PDF\u6587\u6863\u4e2d\u5d4c\u5165\u7684\u9644\u4ef6\u6587\u4ef6\u5bfc\u51fa\u5e76\u4fdd\u5b58\u4e3a\u4e00\u4e2a\u5355\u72ec\u7684\u6587\u4ef6\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\u6bb5\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);\">\/\/ Get information of attachments.<\/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);\">Attachments attachments = new Attachments(doc, empty_nametree);<\/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);\">int count = attachments.getCount();<\/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);\">for (int i = 0; i &lt; count; i++) {<\/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);\">String key = attachments.getKey(i);<\/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);\">FileSpec file_spec = attachments.getEmbeddedFile(key);<\/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);\">if (!file_spec.isEmpty()) {<\/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);\">String name = file_spec.getFileName();<\/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);\">if (file_spec.isEmbedded()) {<\/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);\">String export_file_path = output_path + name;<\/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);\">file_spec.exportToFile(export_file_path);<\/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);\">}<\/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);\">}<\/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);\">}<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8bf7\u53c2\u8003\u4ee5\u4e0b\u4ee3\u7801\u6bb5\uff1a \/\/ Get information of attachments. Attachment [&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-374","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\/374","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=374"}],"version-history":[{"count":0,"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=\/wp\/v2\/posts\/374\/revisions"}],"wp:attachment":[{"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=374"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=374"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=374"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}