onsitesurvey/src/components/pdf/SuitableDownloadPdf.tsx

688 lines
32 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

'use client'
import { useRef } from 'react'
import generatePDF, { Margin, Resolution } from 'react-to-pdf'
export default function SuitableDownloadPdf() {
const targetRef = useRef<HTMLDivElement>(null)
const handleDownPdf = () => {
const options = {
method: 'open' as const,
resolution: Resolution.HIGH,
page: {
margin: Margin.SMALL,
format: 'A4',
orientation: 'landscape' as const,
},
canvas: {
mimeType: 'image/png' as const,
qualityRatio: 1,
},
overrides: {
pdf: {
compress: true,
},
canvas: {
useCORS: true,
},
},
}
generatePDF(targetRef, options)
// generatePDF(targetRef, { filename: 'page.pdf' })
}
return (
<>
<div className="pdf-table-wrap" ref={targetRef}>
<div className="pdf-intro-page">
<div className="pdf-intro-tit-wrap">
<div className="pdf-intro-tit mb20"></div>
<div className="pdf-intro-tit mb20">() </div>
<div className="pdf-intro-date">2025430 10:40</div>
</div>
<div className="pdf-intro-cont-wrap">
<p>使</p>
<p></p>
<p></p>
<p></p>
</div>
</div>
<div className="pdf-table-content">
<div className="pdf-table-grid-wrap">
<div className="pdf-table-card">
<div className="pdf-table-tit-wrap">
<span></span>
<span></span>
<span></span>
</div>
<div className="pdf-roof-table">
<table>
<colgroup>
<col width={'18%'} />
<col width={'23%'} />
<col width={'18%'} />
<col />
</colgroup>
<thead>
<tr>
<th></th>
<th></th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<tr>
<td></td>
<td></td>
<td> </td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td> </td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td> </td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td> </td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td> </td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td> </td>
<td></td>
</tr>
</tbody>
</table>
</div>
</div>
<div className="pdf-table-card">
<div className="pdf-table-tit-wrap">
<span></span>
<span></span>
<span></span>
</div>
<div className="pdf-roof-table">
<table>
<colgroup>
<col width={'18%'} />
<col width={'23%'} />
<col width={'18%'} />
<col />
</colgroup>
<thead>
<tr>
<th></th>
<th></th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<tr>
<td></td>
<td></td>
<td> </td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td> </td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td> </td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td> </td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td> </td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td> </td>
<td></td>
</tr>
</tbody>
</table>
</div>
</div>
<div className="pdf-table-card">
<div className="pdf-table-tit-wrap">
<span></span>
<span></span>
<span></span>
</div>
<div className="pdf-roof-table">
<table>
<colgroup>
<col width={'18%'} />
<col width={'23%'} />
<col width={'18%'} />
<col />
</colgroup>
<thead>
<tr>
<th></th>
<th></th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<tr>
<td></td>
<td></td>
<td> </td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td> </td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td> </td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td> </td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td> </td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td> </td>
<td></td>
</tr>
</tbody>
</table>
</div>
</div>
<div className="pdf-table-card">
<div className="pdf-table-tit-wrap">
<span></span>
<span></span>
<span></span>
</div>
<div className="pdf-roof-table">
<table>
<colgroup>
<col width={'18%'} />
<col width={'23%'} />
<col width={'18%'} />
<col />
</colgroup>
<thead>
<tr>
<th></th>
<th></th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<tr>
<td></td>
<td></td>
<td> </td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td> </td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td> </td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td> </td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td> </td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td> </td>
<td></td>
</tr>
</tbody>
</table>
</div>
</div>
<div className="pdf-table-card">
<div className="pdf-table-tit-wrap">
<span></span>
<span></span>
<span></span>
</div>
<div className="pdf-roof-table">
<table>
<colgroup>
<col width={'18%'} />
<col width={'23%'} />
<col width={'18%'} />
<col />
</colgroup>
<thead>
<tr>
<th></th>
<th></th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<tr>
<td></td>
<td></td>
<td> </td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td> </td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td> </td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td> </td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td> </td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td> </td>
<td></td>
</tr>
</tbody>
</table>
</div>
</div>
<div className="pdf-table-card">
<div className="pdf-table-tit-wrap">
<span></span>
<span></span>
<span></span>
</div>
<div className="pdf-roof-table">
<table>
<colgroup>
<col width={'18%'} />
<col width={'23%'} />
<col width={'18%'} />
<col />
</colgroup>
<thead>
<tr>
<th></th>
<th></th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<tr>
<td></td>
<td></td>
<td> </td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td> </td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td> </td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td> </td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td> </td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td> </td>
<td></td>
</tr>
</tbody>
</table>
</div>
</div>
<div className="pdf-table-card">
<div className="pdf-table-tit-wrap">
<span></span>
<span></span>
<span></span>
</div>
<div className="pdf-roof-table">
<table>
<colgroup>
<col width={'18%'} />
<col width={'23%'} />
<col width={'18%'} />
<col />
</colgroup>
<thead>
<tr>
<th></th>
<th></th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<tr>
<td></td>
<td></td>
<td> </td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td> </td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td> </td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td> </td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td> </td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td> </td>
<td></td>
</tr>
</tbody>
</table>
</div>
</div>
<div className="pdf-table-card">
<div className="pdf-table-tit-wrap">
<span></span>
<span></span>
<span></span>
</div>
<div className="pdf-roof-table">
<table>
<colgroup>
<col width={'18%'} />
<col width={'23%'} />
<col width={'18%'} />
<col />
</colgroup>
<thead>
<tr>
<th></th>
<th></th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<tr>
<td></td>
<td></td>
<td> </td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td> </td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td> </td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td> </td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td> </td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td> </td>
<td></td>
</tr>
</tbody>
</table>
</div>
</div>
<div className="pdf-table-card">
<div className="pdf-table-tit-wrap">
<span></span>
<span></span>
<span></span>
</div>
<div className="pdf-roof-table">
<table>
<colgroup>
<col width={'18%'} />
<col width={'23%'} />
<col width={'18%'} />
<col />
</colgroup>
<thead>
<tr>
<th></th>
<th></th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<tr>
<td></td>
<td></td>
<td> </td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td> </td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td> </td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td> </td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td> </td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td> </td>
<td></td>
</tr>
</tbody>
</table>
</div>
</div>
<div className="pdf-table-card">
<div className="pdf-table-tit-wrap">
<span></span>
<span></span>
<span></span>
</div>
<div className="pdf-roof-table">
<table>
<colgroup>
<col width={'18%'} />
<col width={'23%'} />
<col width={'18%'} />
<col />
</colgroup>
<thead>
<tr>
<th></th>
<th></th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<tr>
<td></td>
<td></td>
<td> </td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td> </td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td> </td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td> </td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td> </td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td> </td>
<td></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</>
)
}