{"id":439,"date":"2023-11-27T15:00:56","date_gmt":"2023-11-27T07:00:56","guid":{"rendered":""},"modified":"2025-01-02T17:12:35","modified_gmt":"2025-01-02T09:12:35","slug":"article-slug-284","status":"publish","type":"post","link":"https:\/\/support.fuxinsoft.cn\/?p=439","title":{"rendered":"\u798f\u6615RDK Android\u5982\u4f55\u4ece\u6307\u5b9a\u7684 PDF \u6587\u4ef6\u8def\u5f84\u6253\u5f00\u4e00\u4e2a PDF \u6587\u6863\uff1f"},"content":{"rendered":"<p style=\"margin-top: 10px; margin-bottom: 0px; padding: 0px;\">\u798f\u6615 SDK for Android \u63d0\u4f9b\u4e86\u591a\u4e2a\u63a5\u53e3\u7528\u6765\u6253\u5f00 PDF \u6587\u6863\u3002\u60a8\u53ef\u4ee5\u4ece\u6307\u5b9a\u7684 PDF \u6587\u4ef6\u8def\u5f84\u6216\u4ece\u5185\u5b58\u7f13\u51b2\u533a\u6253\u5f00\u4e00\u4e2a PDF \u6587\u6863\u3002\u5bf9\u4e8e\u6307\u5b9a\u7684 PDF \u6587\u4ef6\u8def\u5f84\uff0c\u6709\u4e24\u79cd\u65b9\u6cd5\u53ef\u4ee5\u4f7f\u7528\u3002<\/p>\n<p style=\"margin-top: 10px; margin-bottom: 0px; padding: 0px;\">\u7b2c\u4e00\u79cd\u662f\u4f7f\u7528 openDoc \u63a5\u53e3\uff0c\u8be5\u63a5\u53e3\u5305\u62ec\u4ee5\u4e0b\u7684\u64cd\u4f5c\uff1a\u521b\u5efa PDF \u6587\u6863\u5bf9\u8c61(PDFDoc(Stringpath))\uff0c\u52a0\u8f7d\u6587\u6863\u5185\u5bb9(load)\uff0c\u4ee5\u53ca\u5c06 PDF \u6587\u6863\u5bf9\u8c61\u8bbe\u7f6e\u7ed9\u89c6\u56fe\u63a7\u4ef6(setDoc)\u3002<\/p>\n<p style=\"margin-top: 10px; margin-bottom: 0px; padding: 0px;\">\u4ee5\u4e0b\u662f\u793a\u4f8b\u4ee3\u7801\uff1a<br \/>String path = &quot;\/mnt\/sdcard\/input_files\/Sample.pdf&quot;;<\/p>\n<p style=\"margin-top: 10px; margin-bottom: 0px; padding: 0px;\">pdfViewCtrl.openDoc(path, null);<\/p>\n<p style=\"margin-top: 10px; margin-bottom: 0px; padding: 0px;\">\u7b2c\u4e8c\u79cd\u662f\u4f7f\u7528 PDFDoc(String path) \u63a5\u53e3\u521b\u5efa PDF \u6587\u6863\u5bf9\u8c61\uff0c\u4f7f\u7528 load \u63a5\u53e3\u52a0\u8f7d\u6587\u6863\u5185\u5bb9\uff0c\u7136\u540e\u4f7f\u7528 setDoc \u5c06 PDF \u6587\u6863\u5bf9\u8c61\u8bbe\u7f6e\u7ed9\u89c6\u56fe\u63a7\u4ef6\u3002\u4ee5\u4e0b\u662f\u793a\u4f8b\u4ee3\u7801\uff1a<\/p>\n<p style=\"margin-top: 10px; margin-bottom: 0px; padding: 0px;\">String path = &quot;\/mnt\/sdcard\/input_files\/Sample.pdf&quot;;<\/p>\n<p style=\"margin-top: 10px; margin-bottom: 0px; padding: 0px;\">try {<\/p>\n<p style=\"margin-top: 10px; margin-bottom: 0px; padding: 0px;\">\/\/ Initialize a PDFDoc object with the path to the PDF file.<\/p>\n<p style=\"margin-top: 10px; margin-bottom: 0px; padding: 0px;\">PDFDoc document = new PDFDoc(path);<\/p>\n<p style=\"margin-top: 10px; margin-bottom: 0px; padding: 0px;\">\/\/ Load the unencrypted document content.<\/p>\n<p style=\"margin-top: 10px; margin-bottom: 0px; padding: 0px;\">document.load(null);<\/p>\n<p style=\"margin-top: 10px; margin-bottom: 0px; padding: 0px;\">\/\/ Set the document to view control.<\/p>\n<p style=\"margin-top: 10px; margin-bottom: 0px; padding: 0px;\">pdfViewCtrl.setDoc(document);<\/p>\n<p style=\"margin-top: 10px; margin-bottom: 0px; padding: 0px;\">} catch (Exception e) {<\/p>\n<p style=\"margin-top: 10px; margin-bottom: 0px; padding: 0px;\">\/\/ TODO Auto-generated catch block<\/p>\n<p style=\"margin-top: 10px; margin-bottom: 0px; padding: 0px;\">e.printStackTrace();<\/p>\n<p style=\"margin-top: 10px; margin-bottom: 0px; padding: 0px;\">}<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u798f\u6615 SDK for Android \u63d0\u4f9b\u4e86\u591a\u4e2a\u63a5\u53e3\u7528\u6765\u6253\u5f00 PDF \u6587\u6863\u3002\u60a8\u53ef\u4ee5\u4ece\u6307\u5b9a\u7684 PDF \u6587\u4ef6\u8def\u5f84\u6216 [&hellip;]<\/p>\n","protected":false},"author":11,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[85],"tags":[],"class_list":["post-439","post","type-post","status-publish","format-standard","hentry","category-rdk-android"],"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\/439","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=439"}],"version-history":[{"count":1,"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=\/wp\/v2\/posts\/439\/revisions"}],"predecessor-version":[{"id":3982,"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=\/wp\/v2\/posts\/439\/revisions\/3982"}],"wp:attachment":[{"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=439"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=439"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=439"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}