{"id":11213,"date":"2022-11-12T07:00:45","date_gmt":"2022-11-11T22:00:45","guid":{"rendered":"https:\/\/blog.capilano-fw.com\/?p=11213"},"modified":"2022-11-08T05:27:41","modified_gmt":"2022-11-07T20:27:41","slug":"laravel-react-%e3%83%96%e3%83%a9%e3%82%a6%e3%82%b6%e3%81%a0%e3%81%91%e3%81%a7pdf-%e3%82%92%e3%81%a4%e3%81%8f%e3%82%8b","status":"publish","type":"post","link":"https:\/\/blog.capilano-fw.com\/?p=11213","title":{"rendered":"Laravel + React \u30d6\u30e9\u30a6\u30b6\u3060\u3051\u3067PDF \u3092\u3064\u304f\u308b"},"content":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u5c11\u3057\u524d\u304b\u3089<code>React<\/code>\u306e\u8a18\u4e8b\u3092\u516c\u958b\u3057\u3066\u304d\u3066\u3044\u307e\u3059\u304c\u3001\u73fe\u72b6\u3067\u8a00\u3044\u307e\u3059\u3068<code>Vue 3<\/code>\u3088\u308a<code>React<\/code>\u306e\u65b9\u304c\u597d\u304d\u306b\u306a\u3063\u3066\u304d\u3066\u3044\u308b\u4eca\u65e5\u3053\u306e\u9803\u3067\u3059\u3002<\/p>\n<p>\u305d\u3057\u3066\u3001\u305d\u3093\u306a<code>React<\/code>\u3067\u4eca\u56de\u3064\u304f\u3063\u3066\u307f\u305f\u304f\u306a\u3063\u305f\u6a5f\u80fd\u306f\u30fb\u30fb\u30fb\u30fb\u30fb\u30fb<\/p>\n<p><strong style=\"font-size: 35px;\">JavaScript\uff08\u30d6\u30e9\u30a6\u30b6\uff09\u3060\u3051\u3067PDF\u3092\u3064\u304f\u308b<\/strong><\/p>\n<p>\u3068\u3044\u3046\u3082\u306e\u3067\u3059\u3002<\/p>\n<p>\u3082\u3061\u308d\u3093<code>PHP<\/code>\u306e\u3088\u3046\u306a\u30b5\u30fc\u30d0\u30fc\u30b5\u30a4\u30c9\u3067\u3064\u304f\u308b\u306e\u3082\u3044\u3044\u3067\u3059\u304c\u3001<code>JavaScript<\/code>\u3060\u3051\u3067\u4f5c\u6210\u3067\u304d\u308b\u3068\u306a\u308b\u3068\u3001\u306a\u3093\u306a\u3089\u9759\u7684\u306a<code>HTML<\/code>\u3060\u3051\u3067\u5b9f\u88c5\u304c\u3067\u304d\u308b\u3061\u3083\u3046\u308f\u3051\u3067\u3059\u306d\u3002<\/p>\n<p>\u305d\u3053\u3067\u2757<\/p>\n<p>\u4eca\u56de\u306f\u300c<strong>React<\/strong>\u300d\u3067\u8868\u793a\u3055\u308c\u3066\u3044\u308b\u30da\u30fc\u30b8\u3092\u307e\u308b\u3054\u3068<code>PDF<\/code>\u5316\u3057\u3066\u307f\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u305c\u3072\u4f55\u304b\u306e\u53c2\u8003\u306b\u306a\u308a\u307e\u3057\u305f\u3089\u5b09\u3057\u3044\u3067\u3059\u3002\ud83d\ude04\u2728<\/p>\n<p style=\"text-align: center;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3566 aligncenter\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/no_1.png\" alt=\"\" width=\"306\" height=\"320\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/no_1.png 306w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/no_1-287x300.png 287w\" sizes=\"auto, (max-width: 306px) 100vw, 306px\" \/>\u300c\u6700\u5bc4\u308a\u99c5\u306b<br \/>\n\u30b9\u30c8\u30ea\u30fc\u30c8\u30d4\u30a2\u30ce\u304c<br \/>\n\u8a2d\u7f6e\u3055\u308c\u307e\u3057\u305f\ud83c\udfb9\u2728\u300d<\/p>\n<p><strong>\u958b\u767a\u74b0\u5883\uff1a<\/strong> Laravel 9.x\u3001React\u3001Inertia.js\u3001Vite\u3001TailwindCSS<\/p>\n<h1>\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b<\/h1>\n<p>\u3067\u306f\u3001\u307e\u305a\u306f\u4eca\u56de\u306e\u6a5f\u80fd\u306b\u5fc5\u8981\u306b\u306a\u308b\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><strong>npm install jspdf --save-dev<\/strong><\/pre>\n<h1>\u30eb\u30fc\u30c8\u3092\u3064\u304f\u308b<\/h1>\n<p>\u7d9a\u3044\u3066\u30eb\u30fc\u30c8\u3067\u3059\u3002<br \/>\n\u4eca\u56de\u306f\uff11\u3064\u3060\u3051\u3067OK\u3067\u3059\u3002<\/p>\n<p><strong>routes\/web.php<\/strong><\/p>\n<pre><strong>Route::get('pdf', fn() =&gt; Inertia::render('Pdf\/Index'));<\/strong><\/pre>\n<h1>jsPDF \u3092\u65e5\u672c\u8a9e\u5316\u3059\u308b<\/h1>\n<p><code>PDF<\/code>\u306e\u4f5c\u6210\u90e8\u5206\u3092\u66f8\u3044\u3066\u3044\u304f\u524d\u306b\u3001<code>jsPDF<\/code>\u3092\u65e5\u672c\u8a9e\u5316\u3059\u308b\u6e96\u5099\u3092\u3057\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u307e\u305a\u306f\u3001\u4ee5\u4e0b\u306e\u30da\u30fc\u30b8\u304b\u3089\u300c<strong>ipaexg00401.zip<\/strong>\u300d\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u307e\u3059\u3002<\/p>\n<p>\ud83d\udcdd <a href=\"https:\/\/moji.or.jp\/ipafont\/ipaex00401\/\" target=\"_blank\" rel=\"noopener\">IPAex\u30d5\u30a9\u30f3\u30c8 Ver.004.01<\/a><\/p>\n<p>\u305d\u3057\u3066\u3001\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u305f\u3089<code>zip<\/code>\u30d5\u30a1\u30a4\u30eb\u3092\u5c55\u958b\u3057\u307e\u3059\u3002<\/p>\n<p>\u3059\u308b\u3068\u3001\u4e2d\u306b\u300c<strong>ipaexg.ttf<\/strong>\u300d\u3068\u3044\u3046\u30d5\u30a9\u30f3\u30c8\u7528\u30d5\u30a1\u30a4\u30eb\u304c\u3042\u308b\u306e\u3067\u3001\u3053\u308c\u3092<code>jsPDF<\/code>\u3067\u4f7f\u3048\u308b\u3088\u3046\u306b\u52a0\u5de5\u3057\u307e\u3059\u3002<\/p>\n<p>\u3067\u306f\u3001\u4ee5\u4e0b\u306e\uff08\u672c\u5bb6\u304c\u7528\u610f\u3057\u3066\u304f\u308c\u3066\u3044\u308b\uff09\u30da\u30fc\u30b8\u3078\u30a2\u30af\u30bb\u30b9\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\ud83d\udcdd <a href=\"https:\/\/rawgit.com\/MrRio\/jsPDF\/master\/fontconverter\/fontconverter.html\" target=\"_blank\" rel=\"noopener\">\u5909\u63db\u30da\u30fc\u30b8<\/a><\/p>\n<p>\u3059\u308b\u3068\u3001\u5909\u63db\u30d5\u30a9\u30fc\u30e0\u304c\u8868\u793a\u3055\u308c\u308b\u306e\u3067\u4ee5\u4e0b\u3092\u53c2\u8003\u306b\u3057\u3066\u5165\u529b\uff06\u9078\u629e\u3057\u3001\u300c<strong>Create<\/strong>\u300d\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<ul>\n<li><strong>fontName\uff1a<\/strong> ipaexg\uff08\u203b\uff11\uff09<\/li>\n<li><strong>fontStyle\uff1a<\/strong> normal<\/li>\n<li><strong>Module format\uff1a<\/strong> ES modules<\/li>\n<li><strong>File\uff1a<\/strong> \uff08\u5148\u307b\u3069\u5c55\u958b\u3057\u305f ipaexg.ttf \u3092\u30d5\u30a1\u30a4\u30eb\u3067\u9078\u629e\uff09<\/li>\n<\/ul>\n<p>\u203b\uff11 \u597d\u304d\u306a\u540d\u524d\u3067OK\u3067\u3059\u304c\u3001\u305d\u306e\u5834\u5408\u306f\u305d\u306e\u4ed6\u306e\u90e8\u5206\u3082\u3059\u3079\u3066\u5909\u66f4\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11220\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/11\/laravel_react_pdf_2.png\" alt=\"\" width=\"382\" height=\"260\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/11\/laravel_react_pdf_2.png 382w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/11\/laravel_react_pdf_2-300x204.png 300w\" sizes=\"auto, (max-width: 382px) 100vw, 382px\" \/><\/p>\n<p>\u3059\u308b\u3068\u3001\u81ea\u52d5\u7684\u306b\u300c<strong>ipaexg-normal.js<\/strong>\u300d\u3068\u3044\u3046\u30d5\u30a1\u30a4\u30eb\u304c\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3055\u308c\u307e\u3059\u306e\u3067\u3001\u3053\u306e\u30d5\u30a1\u30a4\u30eb\u3092<code>Laravel<\/code>\u306e\u300c<strong>resources\/js\/Pages\/Pdf\/ipaexg-normal.js<\/strong>\u300d\u3078\u79fb\u52d5\u3057\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11219\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/11\/laravel_algolia_related_data_13-1.png\" alt=\"\" width=\"366\" height=\"178\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/11\/laravel_algolia_related_data_13-1.png 366w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/11\/laravel_algolia_related_data_13-1-300x146.png 300w\" sizes=\"auto, (max-width: 366px) 100vw, 366px\" \/><\/p>\n<h1>\u30d3\u30e5\u30fc\u3092\u3064\u304f\u308b<\/h1>\n<p>\u3067\u306f\u3001\u5148\u307b\u3069\u8a2d\u7f6e\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u3082\u4f7f\u3063\u3066\u30e1\u30a4\u30f3\u306e\u30b3\u30fc\u30c9\u3092\u66f8\u3044\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u2757<\/p>\n<p><strong>resources\/js\/Pages\/Pdf\/Index.jsx<\/strong><\/p>\n<pre><strong>import {useEffect, useRef} from \"react\";<\/strong>\r\n<strong>import { jsPDF } from \"jspdf\";<\/strong>\r\n<strong>import \".\/ipaexg-normal\"; \/\/ \ud83d\udc48 \u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u305f\u30d5\u30a1\u30a4\u30eb<\/strong>\r\n\r\n<strong>export default function Index() {<\/strong>\r\n\r\n<strong>    \/\/ PDF<\/strong>\r\n<strong>    const pdfRef = useRef(new jsPDF());<\/strong>\r\n<strong>    const getFileName = () =&gt; {<\/strong>\r\n\r\n<strong>        const timestamp = new Date().getTime();<\/strong>\r\n\r\n<strong>        return `download_${timestamp}.pdf`;<\/strong>\r\n\r\n<strong>    };<\/strong>\r\n<strong>    const savePdf = () =&gt; {<\/strong>\r\n\r\n<strong>        const target = document.querySelector('#pdf');<\/strong>\r\n\r\n<strong>        pdfRef.current.html(target, {<\/strong>\r\n<strong>            callback(doc) {<\/strong>\r\n\r\n<strong>                const fileName = getFileName();<\/strong>\r\n<strong>                doc.save(fileName); \/\/ \ud83d\udc48 \u3053\u3053\u3067 PDF \u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9<\/strong>\r\n\r\n<strong>            },<\/strong>\r\n<strong>            x: 15,<\/strong>\r\n<strong>            y: 15,<\/strong>\r\n<strong>            width: 170,<\/strong>\r\n<strong>            windowWidth: 650<\/strong>\r\n<strong>        });<\/strong>\r\n\r\n<strong>    };<\/strong>\r\n\r\n<strong>    \/\/ Font<\/strong>\r\n<strong>    useEffect(() =&gt; {<\/strong>\r\n\r\n<strong>        pdfRef.current.setFont('ipaexg'); \/\/ \ud83d\udc48 \u30d5\u30a9\u30f3\u30c8\u3092\u8ffd\u52a0<\/strong>\r\n\r\n<strong>    }, []);<\/strong>\r\n\r\n<strong>    return (<\/strong>\r\n<strong>        &lt;div className=\"p-5\"&gt;<\/strong>\r\n<strong>            &lt;div id=\"pdf\" className=\"mb-5\" style={{fontFamily: 'ipaexg', lineHeight: '2.5rem'}}&gt;<\/strong>\r\n<strong>                &lt;div&gt;\u3053\u3053\u306e\u5185\u5bb9\u304c PDF \u5316\u3055\u308c\u307e\u3059&lt;\/div&gt;<\/strong>\r\n<strong>                &lt;ul&gt;<\/strong>\r\n<strong>                    &lt;li className=\"bg-red-500 p-3\"&gt;List 1&lt;\/li&gt;<\/strong>\r\n<strong>                    &lt;li className=\"bg-blue-500 p-3\"&gt;List 2&lt;\/li&gt;<\/strong>\r\n<strong>                    &lt;li className=\"bg-yellow-500 p-3\"&gt;List 3&lt;\/li&gt;<\/strong>\r\n<strong>                &lt;\/ul&gt;<\/strong>\r\n<strong>            &lt;\/div&gt;<\/strong>\r\n<strong>            &lt;button<\/strong>\r\n<strong>                type=\"button\"<\/strong>\r\n<strong>                className=\"text-white bg-blue-700 font-medium rounded-full text-sm px-5 py-2.5 text-center mr-2 mb-2 blue-800\"<\/strong>\r\n<strong>                onClick={() =&gt; savePdf()}&gt;<\/strong>\r\n<strong>                \u4fdd\u5b58\u3059\u308b<\/strong>\r\n<strong>            &lt;\/button&gt;<\/strong>\r\n<strong>        &lt;\/div&gt;<\/strong>\r\n<strong>    );<\/strong>\r\n\r\n<strong>}<\/strong><\/pre>\n<p>\u3053\u306e\u4e2d\u3067\u91cd\u8981\u306a\u306e\u304c\u3001\u30da\u30fc\u30b8\u3092\u8aad\u307f\u8fbc\u3093\u3060\u6642\u306b\u30d5\u30a9\u30f3\u30c8\u3092\u30bb\u30c3\u30c8\u3057\u3066\u3044\u308b<code>useEffect<\/code>\u306e\u90e8\u5206\u3067\u3059\u3002<\/p>\n<pre><strong>useEffect(() =&gt; {<\/strong>\r\n\r\n<strong>    pdfRef.current.setFont('ipaexg');<\/strong>\r\n\r\n<strong>}, []);<\/strong><\/pre>\n<p>\u3053\u308c\u306f\u3001\u300c<strong>ipaexg-normal.js<\/strong>\u300d\u306e\u4e2d\u3067<strong>\u30d5\u30a9\u30f3\u30c8\u306f\u8ffd\u52a0\u3055\u308c\u3066\u3044\u307e\u3059\u304c\u3001\u9069\u7528\u306f\u3055\u308c\u3066\u3044\u306a\u3044<\/strong>\u306e\u3067\u3001<code>setFont()<\/code>\u3092\u5b9f\u884c\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u305f\u3081\u3067\u3059\u3002<\/p>\n<p>\u307e\u305f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306bPDF\u5316\u3059\u308b\u30bf\u30b0\u3078\u306e\u30d5\u30a9\u30f3\u30c8\u6307\u5b9a\u3082\u5fd8\u308c\u306a\u3044\u3067\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre>&lt;div id=\"pdf\" className=\"mb-5\" style={{<strong>fontFamily: 'ipaexg'<\/strong>, lineHeight: '2.5rem'}}&gt;<\/pre>\n<p>\u203b \u306a\u304a\u3001<code>Virtual DOM<\/code>\u306e\u4e2d\u3067<code>style<\/code>\u3092\u4f7f\u3046\u3068\u51e6\u7406\u30b9\u30d4\u30fc\u30c9\u304c\u9045\u304f\u306a\u308b\u3089\u3057\u3044\u306e\u3067\u3001\u672c\u756a\u74b0\u5883\u3067\u306f<code>CSS<\/code>\u5185\u3067\u6307\u5b9a\u3059\u308b\u3053\u3068\u3092\u304a\u3059\u3059\u3081\u3057\u307e\u3059\ud83d\udc4d<\/p>\n<p>\u4f5c\u696d\u306f\u3053\u308c\u3067\u7d42\u4e86\u3067\u3059\u3002<br \/>\n\u304a\u3064\u304b\u308c\u3055\u307e\u3067\u3057\u305f\u2757<\/p>\n<h1>\u30c6\u30b9\u30c8\u3057\u3066\u307f\u308b<\/h1>\n<p>\u3067\u306f\u3001\u5b9f\u969b\u306b\u30c6\u30b9\u30c8\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u2757<\/p>\n<p>\u307e\u305a<code>Vite<\/code>\u3092\u8d77\u52d5\u3057\u3001\u300c<strong>http:\/\/******\/pdf<\/strong>\u300d\u3078\u30d6\u30e9\u30a6\u30b6\u3067\u30a2\u30af\u30bb\u30b9\u3057\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11224\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/11\/laravel_react_pdf_3.png\" alt=\"\" width=\"551\" height=\"308\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/11\/laravel_react_pdf_3.png 551w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/11\/laravel_react_pdf_3-300x168.png 300w\" sizes=\"auto, (max-width: 551px) 100vw, 551px\" \/><\/p>\n<p>\u4e0a\u306e\u3088\u3046\u306a\u30da\u30fc\u30b8\u304c\u8868\u793a\u3055\u308c\u308b\u306e\u3067\u3001\u300c<strong>\u4fdd\u5b58\u3059\u308b<\/strong>\u300d\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u3059\u308b\u3068\u3001\u81ea\u52d5\u7684\u306bPDF\u304c\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3055\u308c\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11222\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/11\/laravel_react_pdf_4.png\" alt=\"\" width=\"271\" height=\"87\" \/><\/p>\n<p>\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u3044\u3066\u307f\u308b\u3068\u30fb\u30fb\u30fb\u30fb\u30fb\u30fb<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11225\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/11\/laravel_react_pdf_5.png\" alt=\"\" width=\"609\" height=\"225\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/11\/laravel_react_pdf_5.png 609w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/11\/laravel_react_pdf_5-300x111.png 300w\" sizes=\"auto, (max-width: 609px) 100vw, 609px\" \/><\/p>\n<p>\u306f\u3044\u2757<\/p>\n<p>\u65e5\u672c\u8a9e\u306b\u3082\u306a\u3063\u3066\u3044\u307e\u3059\u3057\u3001\uff08\u3061\u3087\u3063\u3068\u305a\u308c\u3066\u3044\u308b\u90e8\u5206\u306f\u3042\u308a\u307e\u3059\u304c\uff09\u3046\u307e\u304f<code>HTML<\/code>\u306e\u5185\u5bb9\u304c<code>PDF<\/code>\u5316\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u6210\u529f\u3067\u3059\u3002\u2728\ud83d\ude04\ud83d\udc4d<\/p>\n<h1>\u4f01\u696d\u69d8\u3078\u306e\u3054\u63d0\u6848<\/h1>\n<p>\u4eca\u56de\u306f\u3059\u3079\u3066\u30d6\u30e9\u30a6\u30b6\u5074\u3067<code>PDF<\/code>\u3092\u4f5c\u6210\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u3082\u3061\u308d\u3093\u30b5\u30fc\u30d0\u30fc\u5074\u3067\u4f5c\u6210\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u304c\u3001\u30d6\u30e9\u30a6\u30b6\u5358\u4f53\u3067<code>PDF<\/code>\u4f5c\u6210\u3059\u308b\u30e1\u30ea\u30c3\u30c8\u306f\u300c<strong>\u8ca0\u8377\u306e\u8efd\u6e1b<\/strong>\u300d\u3067\u3059\u3002<\/p>\n<p>\u3064\u307e\u308a\u3001\u30b5\u30fc\u30d0\u30fc\u5185\u3067<code>PDF<\/code>\u3092\u591a\u304f\u4f5c\u6210\u3059\u308b\u3068\u30ea\u30bd\u30fc\u30b9\uff08\u2252\u30a8\u30cd\u30eb\u30ae\u30fc\uff09\u3092\u591a\u304f\u4f7f\u3063\u3066\u3057\u307e\u3046\u305f\u3081\u5f31\u3044\u30b5\u30fc\u30d0\u30fc\u3067\u3059\u3068\u3001\u6700\u60aa\u30c0\u30a6\u30f3\u3059\u308b\u3053\u3068\u3082\u8003\u3048\u3089\u308c\u307e\u3059\u3002<\/p>\n<p>\u307e\u305f\u3001<code>AWS<\/code>\u306a\u3069\u3067\u306f\u8ee2\u9001\u6599\u91d1\u304c\u6bd4\u8f03\u7684\u9ad8\u3044\u3068\u8a00\u308f\u308c\u3066\u3044\u307e\u3059\u306e\u3067\u3001\u3067\u304d\u308b\u3060\u3051\u30d6\u30e9\u30a6\u30b6\u3067\u3067\u304d\u308b\u3053\u3068\u306f\u30d6\u30e9\u30a6\u30b6\u5185\u3067\u5b8c\u7d50\u3055\u305b\u3001\u7701\u30b3\u30b9\u30c8\u5316\u3059\u308b\u3068\u3044\u3046\u306e\u3082\u6226\u7565\u306e\u3072\u3068\u3064\u3067\u306f\u306a\u3044\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n<p>\u3082\u3057\u305d\u3046\u3044\u3063\u305f\u3054\u76f8\u8ac7\u304c\u3054\u3056\u3044\u307e\u3057\u305f\u3089\u3001\u3044\u3064\u3067\u3082\u304a\u6c17\u8efd\u306b\u304a\u554f\u3044\u5408\u308f\u305b\u304b\u3089\u3054\u9023\u7d61\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u304a\u5f85\u3061\u3057\u3066\u304a\u308a\u307e\u3059\u2757<\/p>\n<h1>\u304a\u308f\u308a\u306b<\/h1>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u4eca\u56de\u306f\u300c<strong>React + jsPDF<\/strong>\u300d\u3067<code>PDF<\/code>\u3092\u4f5c\u6210\u3057\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<p>\u3088\u308a\u304d\u308c\u3044\u306b\u51fa\u529b\u3059\u308b\u305f\u3081\u306b\u306f\u3001<code>CSS<\/code>\u3092\u8abf\u6574\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u3088\u3046\u3067\u3057\u305f\u304c\u3001<code>TailwindCSS<\/code>\u3082\u4f7f\u3048\u308b\u3088\u3046\u3067\u3057\u305f\u3057\u3001\u30b5\u30a4\u30c8\u306e\u6027\u8cea\u306b\u3088\u3063\u3066\u306f\u9078\u629e\u80a2\u306e\u3072\u3068\u3064\u306b\u306a\u308b\u3093\u3058\u3083\u306a\u3044\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n<p>\u305c\u3072\u307f\u306a\u3055\u3093\u3082\u697d\u3057\u3093\u3067\u3084\u3063\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u306d\u3002<\/p>\n<p>\u3067\u306f\u3067\u306f\u301c\u2757<\/p>\n<p style=\"text-align: center;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4328 aligncenter\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/no_3.png\" alt=\"\" width=\"364\" height=\"320\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/no_3.png 364w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/no_3-300x264.png 300w\" sizes=\"auto, (max-width: 364px) 100vw, 364px\" \/>\u300c\u540d\u523a\u306b\u66f8\u3044\u3066\u308b<br \/>\n\u30e1\u30a2\u30c9\u306b\u30bf\u30a4\u30dd\u767a\u898b\u2026\ud83d\udca6<br \/>\n\uff08\u6559\u3048\u3066\u304f\u3060\u3055\u3063\u3066\u3042\u308a\u304c\u3068\u3046\u3054\u3056\u3044\u307e\u3059\uff09\u300d<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u5c11\u3057\u524d\u304b\u3089React\u306e\u8a18\u4e8b\u3092\u516c\u958b\u3057\u3066\u304d\u3066\u3044\u307e\u3059\u304c\u3001\u73fe\u72b6\u3067\u8a00\u3044\u307e\u3059\u3068Vue 3\u3088\u308aReact\u306e\u65b9\u304c\u597d\u304d\u306b\u306a\u3063\u3066\u304d\u3066\u3044\u308b\u4eca\u65e5\u3053\u306e\u9803\u3067\u3059\u3002 \u305d\u3057\u3066\u3001\u305d\u3093\u306aR &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/blog.capilano-fw.com\/?p=11213\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;Laravel + React \u30d6\u30e9\u30a6\u30b6\u3060\u3051\u3067PDF \u3092\u3064\u304f\u308b&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":11232,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[247,3,118,249,248],"tags":[],"class_list":["post-11213","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-inertia-js","category-laravel","category-react-js","category-tailwind-css","category-vite"],"_links":{"self":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/11213","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=11213"}],"version-history":[{"count":10,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/11213\/revisions"}],"predecessor-version":[{"id":11233,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/11213\/revisions\/11233"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/media\/11232"}],"wp:attachment":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=11213"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=11213"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=11213"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}