Я хочу, чтобы цвета левой и правой дивирования были вниз на последней странице. И, если возможно, добавьте немного накладки на последнюю страницу. (Он будет преобразован в шаблон ручной работы) < /p>
[*] href="https://maxcdn.bootstrapcdn.com/font-aw ... me.min.css"
rel="stylesheet"
/>
html {
-webkit-print-color-adjust: exact;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
width: 21cm;
margin: 0 auto;
font-family: 'Blinker', sans-serif;
}
.container {
display: flex;
flex-direction: row;
width: 100%;
}
.leftPanel {
width: 27%;
background-color: #405544;
padding: 0.7cm;
display: flex;
flex-direction: column;
align-items: center;
}
.rightPanel {
width: 73%;
padding: 0.7cm;
}
page {
background: white;
display: block;
margin: 0 auto;
margin-bottom: 0.5cm;
position: relative;
}
page[size="A4"] {
width: 21cm;
}
@page {
size: 21cm 29.7cm;
padding: 0;
margin: 0mm;
border: none;
}
img {
width: 4cm;
height: 4cm;
margin-bottom: 0.7cm;
object-fit: cover;
object-position: 50% 50%;
}
.user-name {
color: #405544;
font-weight: semibold;
font-size: 1.2cm;
border-bottom: black 6px solid;
padding-bottom: 5px;
font-family: 'Blinker', sans-serif;
}
.section-title-right {
font-weight: bolder;
text-transform: uppercase;
font-size: 0.4cm;
color: black;
margin-top: 1cm;
margin-bottom: 0.2cm;
}
.text {
color: #353c44;
font-size: 0.3cm;
}
.with-line {
border-top: 1px solid black;
margin-top: 0.8cm;
}
.section-details {
display: flex;
justify-content: space-between;
}
.job-title, .job-company, .education-title, .education-school {
font-weight: bold;
color: black;
}
.job-title {
margin-bottom: 0.07cm;
}
.job-description {
margin-top: 0.3cm;
padding-left: 0.3cm;
}
.job-description li {
list-style-type: disc;
margin-bottom: 0.1cm;
}
.job-item, .education-item {
display: flex;
flex-direction: column;
gap: 0.2cm;
}
.education-details {
display: flex;
align-items: center;
}
.p-left-small {
padding-left: 2px;
}
.p-right-small {
padding-right: 2px;
}
page:last-of-type .leftPanel,
page:last-of-type .rightPanel {
min-height: 29.7cm;
}
@media print {
/* Specify page size */
@page {
size: A4;
margin: 0;
height: 29.7cm;
}
/* Add page break after each page */
page {
page-break-after: always;
min-height: 29.7cm;
/* Change background color as needed */
display: block;
}
/* Hide overflowing content on additional pages */
page:last-of-type {
position: relative;
}
/* Adjust leftPanel and rightPanel to have minimum height of 29.7cm */
page .leftPanel, page .rightPanel {
min-height: 29.7cm;
}
/* Adjust the height of the last page to fill the remaining space */
page:last-of-type::after {
content: "";
display: block;
position: absolute;
bottom: 0;
left: 0;
width: 100%;
}
}
src="
/>
CONTACT
(+33) 777 777 77
[email protected]
class="fa fa-map-marker contactIcon"
aria-hidden="true"
>
New York, USA
class="fa fa-linkedin-square contactIcon"
aria-hidden="true"
>
in/loremipsum
loremipsum
SKILLS
EDUCATION
John Doe
Professional Summary
Practical, highly skilled individual demonstrating
out-of-the-box thinking. Optimises cost-effective operations and
improves safety by scrutinising existing practices. Proven success
fulfilling complex project briefs on-time and under budget.
Work history
Software engineer
- Longcot, Oxford
04/2022
-
10/2024
- Maintained project momentum by providing detailed progress
reports and milestone updates to key stakeholders. -
Implemented software performance monitoring tools,
identifying and resolving bottlenecks. -
Oversaw new feature updates to existing software systems to
add functionality. - Maintained project momentum by providing detailed progress
reports and milestone updates to key stakeholders. -
Implemented software performance monitoring tools,
identifying and resolving bottlenecks. -
Oversaw new feature updates to existing software systems to
add functionality.
Software engineer
- Longcot, Oxford
04/2022
-
10/2024
- Maintained project momentum by providing detailed progress
reports and milestone updates to key stakeholders. -
Implemented software performance monitoring tools,
identifying and resolving bottlenecks. -
Oversaw new feature updates to existing software systems to
add functionality. - Maintained project momentum by providing detailed progress
reports and milestone updates to key stakeholders. -
Implemented software performance monitoring tools,
identifying and resolving bottlenecks. -
Oversaw new feature updates to existing software systems to
add functionality. - Maintained project momentum by providing detailed progress
reports and milestone updates to key stakeholders. -
Implemented software performance monitoring tools,
identifying and resolving bottlenecks. -
Oversaw new feature updates to existing software systems to
add functionality.
Software engineer
- Longcot, Oxford
04/2022
-
10/2024
- Maintained project momentum by providing detailed progress
reports and milestone updates to key stakeholders. -
Implemented software performance monitoring tools,
identifying and resolving bottlenecks. -
Oversaw new feature updates to existing software systems to
add functionality. - Maintained project momentum by providing detailed progress
reports and milestone updates to key stakeholders. -
Implemented software performance monitoring tools,
identifying and resolving bottlenecks. -
Oversaw new feature updates to existing software systems to
add functionality.
Software engineer
- Longcot, Oxford
04/2022
-
10/2024
- Maintained project momentum by providing detailed progress
reports and milestone updates to key stakeholders. -
Implemented software performance monitoring tools,
identifying and resolving bottlenecks. -
Oversaw new feature updates to existing software systems to
add functionality.
Education
Bachelors of Science,
Computer Science
02/2022
-
10/2024
University of
Oxford
-
Logincot, Oxford
-
Merit
Bachelors of Science,
Computer Science
02/2022
-
10/2024
University of
Oxford
-
Logincot, Oxford
-
Merit
Bachelors of Science,
Computer Science
02/2022
-
10/2024
University of
Oxford
-
Logincot, Oxford
-
Merit
Bachelors of Science,
Computer Science
02/2022
-
10/2024
University of
Oxford
-
Logincot, Oxford
-
Merit
< /code>
Это моя реализация кукловода < /p>
export async function generatePDFFromHTML(
htmlContent: string,
outputPath: string
): Promise {
const browser = await puppeteer.launch({
headless: true,
});
const page = await browser.newPage();
await page.setContent(htmlContent);
await page.pdf({
path: outputPath,
format: "A4",
displayHeaderFooter: false,
printBackground: true,
margin: {
top: "0.4in",
bottom: "0.4in",
left: "0.4in",
right: "0.4in",
},
});
await browser.close();
}
Подробнее здесь: https://stackoverflow.com/questions/783 ... -full-page