Skip to content

Commit

Permalink
fix for safari
Browse files Browse the repository at this point in the history
  • Loading branch information
ka8725 committed May 31, 2024
1 parent 29ed636 commit 83225bf
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/app/showcases/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ export default function ShowcasePage() {
const elementString = renderToString(<ShowcaseToPDF {...showcase.body} />);
element.innerHTML = elementString;

html2pdf().from(element).set({
html2pdf()
.set({
filename: `${showcase.slug}.pdf`,
image: { type: 'jpeg', quality: 1 },
html2canvas: {
Expand All @@ -46,9 +47,13 @@ export default function ShowcasePage() {
precision: 32
},
pagebreak: { mode: 'avoid-all', before: '.page-break' }
}).save().then(() => {
})
.from(element)
.save()
.then(() => {
setIsLoading(false);
}).catch(() => {
})
.catch(() => {
setIsLoading(false);
});
});
Expand Down

0 comments on commit 83225bf

Please sign in to comment.