{"id":2469,"date":"2024-08-23T09:34:27","date_gmt":"2024-08-23T01:34:27","guid":{"rendered":"https:\/\/support.foxitsoftware.cn\/?p=2469"},"modified":"2024-09-05T14:04:20","modified_gmt":"2024-09-05T06:04:20","slug":"%e3%80%90plugin-sdk%e3%80%91%e5%a6%82%e4%bd%95%e7%94%9f%e6%88%90%e6%a0%bc%e5%bc%8f%e5%8c%96%e9%a1%b5%e7%a0%81%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/support.fuxinsoft.cn\/?p=2469","title":{"rendered":"\u5982\u4f55\u751f\u6210\u683c\u5f0f\u5316\u9875\u7801\uff1f"},"content":{"rendered":"\n<p>\u4ec0\u4e48\u662f\u683c\u5f0f\u5316\u9875\u7801\uff1f<\/p>\n\n\n\n<p>\u5728\u798f\u6615PDF\u7f16\u8f91\u5668\u5de6\u4fa7\u7684\u4fa7\u8fb9\u680f\u4e2d\uff0c\u6253\u5f00\u7f29\u7565\u56fe\uff0c\u9009\u4e2d\u4e00\u4e2a\u7f29\u7565\u56fe\u540e\u53f3\u952e\uff0c\u53ef\u4ee5\u770b\u89c1\u7f16\u8f91\u5668\u4e2d\u6709\u683c\u5f0f\u5316\u9875\u7801\u7684\u529f\u80fd\uff0c\u53ef\u4ee5\u8ba9\u539f\u672c\u662f\u201c1,2,3,4\u201d\u683c\u5f0f\u7684\u9875\u7801\uff0c\u589e\u52a0\u524d\u7f00\uff0c\u6216\u6539\u4e3a\u7f57\u9a6c\u6570\u5b57\u7b49\u6837\u5f0f\u3002<\/p>\n\n\n\n<p>\u5728\u533a\u5206\u6587\u6863\u76ee\u5f55\u3001\u6587\u6863\u7ae0\u8282\u65f6\u6bd4\u8f83\u5e38\u89c1\uff0c\u5728\u7528\u6237\u901a\u8fc7\u7f29\u7565\u56fe\u67e5\u627e\u5185\u5bb9\u65f6\u80fd\u7ed9\u4e88\u63d0\u793a\u7528\u4e8e\u533a\u5206\u4e0d\u540c\u7ae0\u8282\u7b49\u4fe1\u606f\uff0c\u5982\u4e0b\u56fe\u6240\u793a\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img fetchpriority=\"high\" decoding=\"async\" width=\"850\" height=\"511\" src=\"https:\/\/support.fuxinsoft.cn\/wp-content\/uploads\/2024\/08\/image-7.png\" alt=\"\" class=\"wp-image-2472\" style=\"width:619px;height:auto\" srcset=\"https:\/\/support.fuxinsoft.cn\/wp-content\/uploads\/2024\/08\/image-7.png 850w, https:\/\/support.fuxinsoft.cn\/wp-content\/uploads\/2024\/08\/image-7-300x180.png 300w, https:\/\/support.fuxinsoft.cn\/wp-content\/uploads\/2024\/08\/image-7-768x462.png 768w\" sizes=\"(max-width: 850px) 100vw, 850px\" \/><\/figure>\n\n\n\n<p>\u901a\u8fc7SDK\u5b9e\u73b0\u7684\u793a\u4f8b\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code has-body-font-family has-medium-font-size\"><code>\nvoid addPageLanbles()\n{\n\tFR_Document frDocument = FRAppGetActiveDocOfPDDoc();\n\tFPD_Document fpdDocument = FRDocGetPDDoc(frDocument);\n\tFPD_Object docObj= FPDDocGetRoot(fpdDocument);\n\tdocObj = FPDObjectGetDict(docObj);\n\n\tFPD_Object pageLablesObj= FPDDictionaryNew();\n\tFPD_Object numsArray = FPDArrayNew();\n\t\/\/\u4ece\u7b2c0\u9875\u5f00\u59cb\uff0c\u662f\u963f\u62c9\u4f2f\u6570\u5b57\u5f62\u5f0f\u7684\u9875\u7801\n\tint startPageIndex = 0;\n\tFPD_Object pageLable = FPDDictionaryNew();\n\t\/\/\u9875\u7801\u5e8f\u53f7\u7c7b\u578b\uff1a D \u5341\u8fdb\u5236\u963f\u62c9\u4f2f\u6570\u5b57\uff1bR \u5927\u5199\u7f57\u9a6c\u6570\u5b57;r \u5c0f\u5199\u7f57\u9a6c\u6570\u5b57; A \u5927\u5199\u5b57\u6bcd; a\u5c0f\u5199\u5b57\u6bcd\n\tFPDDictionaryAddValue(pageLable, \"S\", FPDNameNew( \"D\"));\n\tFPDDocAddIndirectObject(fpdDocument, pageLable);\n\tFPDArrayAddInteger(numsArray, startPageIndex);\n\tFPDArrayAddReference2ToDoc(numsArray, fpdDocument, pageLable);\n\n\t\/\/\u4ece\u7b2c3\u9875\u5f00\u59cb\uff0c\u81ea\u5b9a\u4e49\u7684\u524d\u7f00\n\tstartPageIndex = 3;\n\tpageLable = FPDDictionaryNew();\n\tFPDDictionaryAddValue(pageLable, \"S\", FPDNameNew(\"R\"));\/\/\u7f57\u9a6c\u6570\u5b57\n\tFPDDictionaryAddValue(pageLable, \"P\", FPDStringNewW(L\"foxit\u798f\u6615_\"));\n\t\/\/\u8be5\u524d\u7f00\u51fa\u73b0\u7684\u7b2c\u4e00\u9875\uff0c\u9875\u7801\u53f7\u4ece1\u5f00\u59cb\uff0c\n\tFS_INT32 prefixSatrt = 1;\n\tFPDDictionaryAddValue(pageLable, \"St\",FPDNumberNewByInt(prefixSatrt));\n\tFPDDocAddIndirectObject(fpdDocument, pageLable);\n\tFPDArrayAddInteger(numsArray, startPageIndex);\/\/\u4ece\u7b2c\u4e09\u4e5f\u5f00\u59cb\u663e\u793a\u5e26\u6709\u524d\u7f00\u7684\u524d\u7f00\u9875\u7801\n\tFPDArrayAddReference2ToDoc(numsArray, fpdDocument, pageLable);\n\n\t\/\/\u4ece\u7b2c6\u9875\u5f00\u59cb\u4e0d\u663e\u793a\u9875\u7801\n\tstartPageIndex = 6;\n\tFPD_Object pageLable2= FPDDictionaryNew();\n\tFPDDictionaryAddValue(pageLable2, \"P\", FPDStringNewW(L\"\"));\/\/\u524d\u7f00\u4e3a\u7a7a\uff0c\u5e76\u4e14\u6ca1\u6709\u9875\u7801\uff08S\uff09\n\tFPDDocAddIndirectObject(fpdDocument, pageLable2);\n\tFPDArrayAddInteger(numsArray, startPageIndex);\n\tFPDArrayAddReference2ToDoc(numsArray, fpdDocument, pageLable2);\n\n\n\tFPDDictionaryAddValue(pageLablesObj, \"Nums\", numsArray);\n\tFPDDictionaryAddValue(docObj, \"PageLabels\", pageLablesObj);\n\tFPDDocSave(fpdDocument, \"D:\/test\/AddPageLables.pdf\", 0, false);\n}<\/code><\/pre>\n\n\n\n<p>\u6548\u679c\u5982\u4e0b\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img decoding=\"async\" width=\"459\" height=\"522\" src=\"https:\/\/support.fuxinsoft.cn\/wp-content\/uploads\/2024\/08\/image-10.png\" alt=\"\" class=\"wp-image-2475\" style=\"width:620px;height:auto\" srcset=\"https:\/\/support.fuxinsoft.cn\/wp-content\/uploads\/2024\/08\/image-10.png 459w, https:\/\/support.fuxinsoft.cn\/wp-content\/uploads\/2024\/08\/image-10-264x300.png 264w\" sizes=\"(max-width: 459px) 100vw, 459px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4ec0\u4e48\u662f\u683c\u5f0f\u5316\u9875\u7801\uff1f \u5728\u798f\u6615PDF\u7f16\u8f91\u5668\u5de6\u4fa7\u7684\u4fa7\u8fb9\u680f\u4e2d\uff0c\u6253\u5f00\u7f29\u7565\u56fe\uff0c\u9009\u4e2d\u4e00\u4e2a\u7f29\u7565\u56fe\u540e\u53f3\u952e\uff0c\u53ef\u4ee5\u770b\u89c1\u7f16\u8f91\u5668\u4e2d\u6709\u683c\u5f0f [&hellip;]<\/p>\n","protected":false},"author":31,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[90],"tags":[],"class_list":["post-2469","post","type-post","status-publish","format-standard","hentry","category-plugin-sdk"],"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\/2469","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\/31"}],"replies":[{"embeddable":true,"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2469"}],"version-history":[{"count":4,"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=\/wp\/v2\/posts\/2469\/revisions"}],"predecessor-version":[{"id":2684,"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=\/wp\/v2\/posts\/2469\/revisions\/2684"}],"wp:attachment":[{"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2469"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2469"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2469"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}