{"id":2382,"date":"2024-10-31T16:05:31","date_gmt":"2024-10-31T07:05:31","guid":{"rendered":"http:\/\/blog.moramcnt.com\/?p=2382"},"modified":"2024-10-31T16:05:31","modified_gmt":"2024-10-31T07:05:31","slug":"react-native-pdf-%ec%b6%9c%eb%a0%a5","status":"publish","type":"post","link":"http:\/\/blog.moramcnt.com\/?p=2382","title":{"rendered":"React Native PDF \ucd9c\ub825"},"content":{"rendered":"<p><strong>I. \ubaa9\ud45c<\/strong><\/p>\n<p>\uc571\uc0c1\uc5d0\uc11c \uc6f9\uc0c1\uc5d0 \uc788\ub294 PDF\ub97c \ucd9c\ub825\ud558\ub294\uac83\uc744 \ubaa9\ud45c\ub85c \ud55c\ub2e4.<\/p>\n<p><b>II. \uc5f0\uad6c<\/b> <b>\ubc0f<\/b> <b>\uac1c\ubc1c\ub0b4\uc6a9<\/b><\/p>\n<p>1. \ubaa8\ub4c8\uc124\uce58<\/p>\n<table style=\"height: 71px; width: 36.8333%; margin-left: 40px; border-style: solid; border-color: #eeeeee; background-color: #ebebeb;\" border=\"1\">\n<tbody style=\"padding-left: 40px;\">\n<tr style=\"padding-left: 40px;\">\n<td style=\"padding-left: 40px;\">npm install &#8211;save react-to-print<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>2. \uad6c\ud604<\/p>\n<p style=\"padding-left: 40px;\">\uac00. \ubaa8\ub4c8 Import<\/p>\n<table style=\"height: 71px; width: 36.8333%; margin-left: 40px; border-style: solid; border-color: #eeeeee; background-color: #ebebeb;\" border=\"1\">\n<tbody>\n<tr>\n<td>import RNPrint from &#8220;react-native-print&#8221;;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"padding-left: 40px;\">\ub098. PDF \ucd9c\ub825<\/p>\n<p style=\"padding-left: 80px;\">\uc6f9\uc73c\ub85c \ubd80\ud130 URL\uc744 \uc218\uc2e0\ubc1b\uc544 RNPrint.print({filePath: PDF\uacbd\ub85c}}) \uba85\ub839\uc744 \uc774\uc6a9\ud558\uc5ec \ucd9c\ub825\ud55c\ub2e4.<\/p>\n<table style=\"height: 498px; width: 50.2518%; margin-left: 40px; border-style: solid; border-color: #eeeeee; background-color: #ebebeb;\" border=\"1\">\n<tbody>\n<tr>\n<td style=\"width: 100%;\">if(consts.MSG_REQUEST_LABEL_PRINT == strMsgId)<\/p>\n<p>{<\/p>\n<p style=\"padding-left: 40px;\">\u00a0 \u00a0 let strUrl = objData.msgData;<\/p>\n<p style=\"padding-left: 40px;\">\u00a0\u00a0\u00a0 console.log(&#8220;=================================&#8221;);<\/p>\n<p style=\"padding-left: 40px;\">\u00a0\u00a0\u00a0 console.log(&#8220;*MSG_REQUEST_LABEL_PRINT, strUrl:&#8221;+ strUrl);<\/p>\n<p style=\"padding-left: 40px;\">\u00a0\u00a0\u00a0 console.log(&#8220;=================================&#8221;);<\/p>\n<p style=\"padding-left: 40px;\">\u00a0\u00a0\u00a0 if(strUrl != null)<\/p>\n<p style=\"padding-left: 40px;\">\u00a0\u00a0\u00a0 {<\/p>\n<p style=\"padding-left: 80px;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 RNPrint.print({ filePath: strUrl })<\/p>\n<p style=\"padding-left: 40px;\">\u00a0\u00a0\u00a0 }<\/p>\n<p>}<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><strong>III. \uacb0\ub860<\/strong><\/p>\n<p>\uc624\ud508\uc18c\uc2a4\ub85c \ub418\uc5b4\uc788\ub294\uac83\uc744 Import\ud558\uae30\ub9cc \ud558\uba74 \ub418\uc11c \uac04\ub2e8\ud788 \ucc98\ub9ac\ud560\uc218 \uc788\uc5c8\ub2e4.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I. \ubaa9\ud45c \uc571\uc0c1\uc5d0\uc11c \uc6f9\uc0c1\uc5d0 \uc788\ub294 PDF\ub97c \ucd9c\ub825\ud558\ub294\uac83\uc744 \ubaa9\ud45c\ub85c \ud55c\ub2e4. II. \uc5f0\uad6c \ubc0f \uac1c\ubc1c\ub0b4\uc6a9 1. \ubaa8\ub4c8\uc124\uce58 npm install &#8211;save react-to-print 2. \uad6c\ud604 \uac00. \ubaa8\ub4c8 Import import RNPrint from &#8220;react-native-print&#8221;; \ub098. PDF \ucd9c\ub825 \uc6f9\uc73c\ub85c \ubd80\ud130 URL\uc744 \uc218\uc2e0\ubc1b\uc544 RNPrint.print({filePath: PDF\uacbd\ub85c}}) \uba85\ub839\uc744 \uc774\uc6a9\ud558\uc5ec \ucd9c\ub825\ud55c\ub2e4. if(consts.MSG_REQUEST_LABEL_PRINT == strMsgId) { \u00a0 \u00a0 let strUrl = objData.msgData; \u00a0\u00a0\u00a0 console.log(&#8220;=================================&#8221;); \u00a0\u00a0\u00a0 console.log(&#8220;*MSG_REQUEST_LABEL_PRINT, strUrl:&#8221;+ [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"footnotes":""},"categories":[21],"tags":[288,259,289],"class_list":["post-2382","post","type-post","status-publish","format-standard","hentry","category-mobile","tag-pdf","tag-react-native","tag-289"],"_links":{"self":[{"href":"http:\/\/blog.moramcnt.com\/index.php?rest_route=\/wp\/v2\/posts\/2382","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/blog.moramcnt.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.moramcnt.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.moramcnt.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.moramcnt.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2382"}],"version-history":[{"count":3,"href":"http:\/\/blog.moramcnt.com\/index.php?rest_route=\/wp\/v2\/posts\/2382\/revisions"}],"predecessor-version":[{"id":2385,"href":"http:\/\/blog.moramcnt.com\/index.php?rest_route=\/wp\/v2\/posts\/2382\/revisions\/2385"}],"wp:attachment":[{"href":"http:\/\/blog.moramcnt.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2382"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.moramcnt.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2382"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.moramcnt.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2382"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}