-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path12html_A4_empty.html
More file actions
253 lines (243 loc) · 11.4 KB
/
Copy path12html_A4_empty.html
File metadata and controls
253 lines (243 loc) · 11.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<title>12쉽소 이력서 출력 A4</title>
<link rel="stylesheet" href="12style_A4.css">
</head>
<body>
<button id="topdfButton" onclick="downloadPDF()" data-html2canvas-ignore="true">PDF로 다운로드</button>
<section class="page">
<div id="topBackground"><p id="logo">12쉽소</p></div>
<table class="topTable">
<tr>
<td class="leftColumn">
<!-- <img src="SampleImage.jpeg" style="width:120px; height:160px"> -->
<div style="width:120px; height:160px; background-color:black;"> . </div>
</td>
<td class="centerColumn">
<div class="topHighlightTextSmall">{자기소개 멘트}</div>
<div class="topHighlightTextLarge">{name}</div>
</td>
<td class="rightColumn">
<div class="roundBoxinRow" style="margin-bottom : 8px;"><p class="infoText">{Personality 1}</p></div>
<div class="roundBoxinRow" style="margin-bottom : 8px;"><p class="infoText">{Personality 2}</p></div>
<div class="roundBoxinRow" style="margin-bottom : 8px;"><p class="infoText">{Personality 3}</p></div>
</td>
</tr>
</table>
<div class="infoBox"><div class="infoLine" style="border-top: 4px solid #001ED6;"></div></div>
<div class="infoBox">
<table class="infoTable">
<tr>
<td class="leftInfoSide">인적사항</td>
<td class="rightInfoSide">
<table class="infoTable">
<tr>
<td class="rightLeftInfo">
<div class="roundBox">이름</div>
</td>
<td class="rightRightInfo">{name}</td>
</tr>
<tr>
<td class="rightLeftInfo">
<div class="roundBox">생년월일</div>
</td>
<td class="rightRightInfo">{birth}</td>
</tr>
<tr>
<td class="rightLeftInfo">
<div class="roundBox">주소</div>
</td>
<td class="rightRightInfo">{adress}</td>
</tr>
<tr>
<td class="rightLeftInfo">
<div class="roundBox">연락처</div>
</td>
<td class="rightRightInfo">{contact}</td>
</tr>
<tr>
<td class="rightLeftInfo">
<div class="roundBox">이메일</div>
</td>
<td class="rightRightInfo">{email}</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<div class="infoBox">
<table class="infoTable">
<tr>
<td class="leftInfoSide">최종<br>학력사항</td>
<td class="rightInfoSide">
<table class="infoTable">
<tr>
<td class="rightLeftInfo">
<div class="roundBox">학교명</div>
</td>
<td class="rightRightInfo">{schoolName}</td>
</tr>
<tr>
<td class="rightLeftInfo">
<div class="roundBox">전공</div>
</td>
<td class="rightRightInfo">{major}</td>
</tr>
<tr>
<td class="rightLeftInfo">
<div class="roundBox">입학연도</div>
</td>
<td class="rightRightInfo">{admissionYear}</td>
</tr>
<tr>
<td class="rightLeftInfo">
<div class="roundBox">졸업연도</div>
</td>
<td class="rightRightInfo">{graduateYear}</td>
</tr>
<tr>
<td class="rightLeftInfo">
<div class="roundBox">학점</div>
</td>
<td class="rightRightInfo">{gradePoint}</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<div class="infoBox">
<table class="infoTable">
<tr>
<td class="leftInfoSide">자격증</td>
<td class="rightInfoSide">
<table class="infoTable">
<tr>
<td class="rightLeftInfo">
<div class="roundBox">자격증명</div>
</td>
<td class="rightRightInfo">{licenseName}</td>
</tr>
<tr>
<td class="rightLeftInfo">
<div class="roundBox">취득연도</div>
</td>
<td class="rightRightInfo">{date}</td>
</tr>
<tr>
<td class="rightLeftInfo">
<div class="roundBox">인증기관</div>
</td>
<td class="rightRightInfo">{agency}</td>
</tr>
<tr>
<td style="padding-top:5px; padding-bottom:5px;" colspan="2"><div class="infoLineSub"></div></td>
</tr>
<tr>
<td class="rightLeftInfo">
<div class="roundBox">자격증명</div>
</td>
<td class="rightRightInfo">{licenseName}</td>
</tr>
<tr>
<td class="rightLeftInfo">
<div class="roundBox">취득연도</div>
</td>
<td class="rightRightInfo">{date}</td>
</tr>
<tr>
<td class="rightLeftInfo">
<div class="roundBox">수학진흥원</div>
</td>
<td class="rightRightInfo">{agency}</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
</section>
<section class="page">
<div id="topBackground2p"><p id="logo">12쉽소</p> </div>
<br>
<br>
<br>
<br>
<div class="infoBox">
<table class="infoTable">
<tr>
<td class="leftInfoSide">경력사항</td>
<td class="rightInfoSide">
<table>
<tr>
<td>
<p class="career"> <span class="roundBoxinText">{place}</span> <span class="roundBoxinText">{team}</span>에서
<span class="roundBoxinText">{periodStart}</span>부터 <span class="roundBoxinText">{periodEnd}</span>까지
<span class="roundBoxinText">{periodYears}</span>동안 <span class="roundBoxinText">{task}</span> 업무를 맡았어요. </p>
</td>
</tr>
<tr>
<td style="padding-top:5px; padding-bottom:5px;" colspan="2"><div class="infoLineSub"></div></td>
</tr>
<tr>
<td>
<p class="career"> <span class="roundBoxinText">{place}</span> <span class="roundBoxinText">{team}</span>에서
<span class="roundBoxinText">{periodStart}</span>부터 <span class="roundBoxinText">{periodEnd}</span>까지
<span class="roundBoxinText">{periodYears}</span>동안 <span class="roundBoxinText">{task}</span> 업무를 맡았어요. </p>
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<br>
<br>
<br>
<div class="infoBox">
<table class="infoTable">
<tr>
<td class="leftInfoSide">자기소개</td>
<td class="rightInfoSide">
<p class="paragraph"> {introductionText} </p>
</td>
</tr>
</table>
</div>
<p id="signature"> 상기 내용이 <span id="eb">사실임을 확인</span>합니다.      {name}     (서명) </p>
</section>
</body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.3.1/jspdf.umd.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/1.3.2/html2canvas.min.js"></script>
<script>
function downloadPDF() {
const pages = document.querySelectorAll('.page');
const doc = new jspdf.jsPDF('p', 'mm', 'a4');
let promises = [];
pages.forEach((page, index) => {
promises.push(
html2canvas(page, {
scale: 3, // 해상도를 높여서 렌더링
useCORS: true // 크로스 오리진 이슈 해결
}).then((canvas) => {
const imgData = canvas.toDataURL('image/png');
const imgWidth = 210; // A4 width in mm
const pageHeight = 297; // A4 height in mm
const imgHeight = canvas.height * imgWidth / canvas.width;
if (index > 0) {
doc.addPage();
}
doc.addImage(imgData, 'PNG', 0, 0, imgWidth, imgHeight);
})
);
});
Promise.all(promises).then(() => {
doc.save('sample.pdf');
});
}
</script>
</html>