{"id":5306,"date":"2025-05-13T14:15:21","date_gmt":"2025-05-13T06:15:21","guid":{"rendered":"https:\/\/support.fuxinsoft.cn\/?p=5306"},"modified":"2025-05-21T17:48:31","modified_gmt":"2025-05-21T09:48:31","slug":"sdk%e7%9a%84pdfpage-startparse%ef%bc%8c%e8%af%a5%e6%80%8e%e4%b9%88%e8%8e%b7%e5%8f%96%e7%a8%8b%e5%ba%8f%e5%a4%84%e7%90%86%e8%bf%9b%e5%ba%a6%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/support.fuxinsoft.cn\/?p=5306","title":{"rendered":"\u5982\u4f55\u83b7\u53d6PDFPage.StartParse()\u7684\u5904\u7406\u8fdb\u5ea6\uff1f"},"content":{"rendered":"\n<p>\u5728\u4f7f\u7528SDK\u8fdb\u884cPDF\u9875\u9762\u89e3\u6790\u65f6\uff0c\u90e8\u5206\u63a5\u53e3\uff08\u5982\u89e3\u6790\u3001\u5199\u5165\u6216\u5bfc\u51fa\u64cd\u4f5c\uff09\u53ef\u80fd\u9700\u8981\u8f83\u957f\u65f6\u95f4\u5b8c\u6210\u3002\u4e3a\u63d0\u5347\u7528\u6237\u4f53\u9a8c\uff0cSDK\u901a\u5e38\u4f1a\u63d0\u4f9b\u4ee5\u4e0b\u63a7\u5236\u529f\u80fd\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u83b7\u53d6\u5b9e\u65f6\u5904\u7406\u8fdb\u5ea6<\/li>\n\n\n\n<li>\u6682\u505c\u5904\u7406\u8fc7\u7a0b<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img fetchpriority=\"high\" decoding=\"async\" width=\"538\" height=\"167\" src=\"https:\/\/support.fuxinsoft.cn\/wp-content\/uploads\/2025\/05\/image-3.png\" alt=\"\" class=\"wp-image-5308\" style=\"width:794px;height:auto\" srcset=\"https:\/\/support.fuxinsoft.cn\/wp-content\/uploads\/2025\/05\/image-3.png 538w, https:\/\/support.fuxinsoft.cn\/wp-content\/uploads\/2025\/05\/image-3-300x93.png 300w\" sizes=\"(max-width: 538px) 100vw, 538px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img decoding=\"async\" width=\"579\" height=\"557\" src=\"https:\/\/support.fuxinsoft.cn\/wp-content\/uploads\/2025\/05\/image-2.png\" alt=\"\" class=\"wp-image-5307\" style=\"width:794px;height:auto\" srcset=\"https:\/\/support.fuxinsoft.cn\/wp-content\/uploads\/2025\/05\/image-2.png 579w, https:\/\/support.fuxinsoft.cn\/wp-content\/uploads\/2025\/05\/image-2-300x289.png 300w\" sizes=\"(max-width: 579px) 100vw, 579px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">\u57fa\u672c\u4f7f\u7528\u8bf4\u660e<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5982\u679c\u4e0d\u9700\u8981\u83b7\u53d6\u8fdb\u5ea6\u4fe1\u606f\uff0c\u53ef\u76f4\u63a5\u5c06\u8fdb\u5ea6\u56de\u8c03\u53c2\u6570\u8bbe\u4e3a<code>null<\/code><\/li>\n\n\n\n<li>\u5982\u9700\u83b7\u53d6\u8fdb\u5ea6\u4fe1\u606f\uff0c\u5219\u5fc5\u987b\u63d0\u4f9b\u6709\u6548\u7684\u56de\u8c03\u5bf9\u8c61<\/li>\n<\/ul>\n\n\n\n<p>C++ \u793a\u4f8b\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>   {\n       PDFPage page = doc.GetPage(0);\n\n       PauseCallback_Custom pause(0, true);\n       common::Progressive progressive = page.StartParse(0, &amp;pause, true);\n       Progressive::State progress_state = Progressive::e_ToBeContinued;\n       while (Progressive::e_ToBeContinued == progress_state) {\n           progress_state = progressive.Continue();\n           int percent = progressive.GetRateOfProgress();\n           String res_string;\n           res_string.Format(\" Progress percent: %d %\", percent);\n           std::cout &lt;&lt; res_string &lt;&lt; std::endl;\n       }\n       if (Progressive::e_Finished == progress_state)\n       {\n           std::cout &lt;&lt; \"Finished\" &lt;&lt; std::endl;\n       }\n   }\n\n\/\/PauseCallback_Custom\u56de\u8c03\uff1a\n\nclass  PauseCallback_Custom : public PauseCallback\n{\npublic:\n    PauseCallback_Custom(int pause_count_limit = 0, bool always_pause = false)\n        :pause_count_(0)\n        , pause_count_limit_(pause_count_limit)\n        , always_pause_(always_pause)\n    {\n\n    }\n\n    virtual FX_BOOL NeedToPauseNow()\n    {\n        if (always_pause_) return true;\n        if (pause_count_ &lt; pause_count_limit_)\n        {\n            pause_count_++;\n            return 1;\n        }\n        else {\n            pause_count_ = 0;\n            return 0;\n        }\n    }\n\n    void  ClearCount()\n    {\n        pause_count_ = 0;\n    }\n\nprivate:\n    int pause_count_limit_;\n    int pause_count_;\n    bool always_pause_;\n};\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u4f7f\u7528SDK\u8fdb\u884cPDF\u9875\u9762\u89e3\u6790\u65f6\uff0c\u90e8\u5206\u63a5\u53e3\uff08\u5982\u89e3\u6790\u3001\u5199\u5165\u6216\u5bfc\u51fa\u64cd\u4f5c\uff09\u53ef\u80fd\u9700\u8981\u8f83\u957f\u65f6\u95f4\u5b8c\u6210\u3002\u4e3a\u63d0\u5347\u7528\u6237\u4f53\u9a8c\uff0cSD [&hellip;]<\/p>\n","protected":false},"author":31,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[77],"tags":[575,584,577,585],"class_list":["post-5306","post","type-post","status-publish","format-standard","hentry","category-gsdk","tag-pausecallback","tag-pdfpage-startparse","tag-577","tag-585"],"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\/5306","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=5306"}],"version-history":[{"count":3,"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=\/wp\/v2\/posts\/5306\/revisions"}],"predecessor-version":[{"id":5378,"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=\/wp\/v2\/posts\/5306\/revisions\/5378"}],"wp:attachment":[{"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5306"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5306"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5306"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}