Skip to content

Commit

Permalink
feat(pdf): break page before pictures
Browse files Browse the repository at this point in the history
  • Loading branch information
ledouxm committed Nov 12, 2024
1 parent 73afd33 commit 762821e
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions packages/pdf/src/report.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Document, Font, Page } from "@react-pdf/renderer";
import { Document, Font, Image, Page, View } from "@react-pdf/renderer";
import { Html } from "react-pdf-html";
import React from "react";
import type { Udap, Report, Service_instructeurs, Clause_v2, Pictures } from "@cr-vif/electric-client/frontend";
Expand Down Expand Up @@ -150,19 +150,19 @@ export const ReportPDFDocument = ({ udap, htmlString, images, pictures }: Report
<div class="content">
${htmlString}
</div>
${
pictures
? `<div class="pictures">
${pictures
.filter((pic) => !!pic.url)
.map((pic) => `<img src="${pic.url}" />`)
.join("")}
</div>`
: ""
}
</body>
</html>
`}</Html>
{pictures ? (
<View break>
{pictures
.filter((pic) => !!pic.url)
.map((pic) => (
<Image key={pic.id} style={{ width: `100%`, height: "auto" }} src={pic.url!} />
))}
</View>
) : null}
</Page>
</Document>
);
Expand Down

0 comments on commit 762821e

Please sign in to comment.