You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
writer.append(cover) # cover can be 1 or multiple pages
53
+
writer.append(body)
54
+
writer.write(out)
55
+
print(f"Created {out}")
56
+
PY
57
+
# pypdf supports merging by appending PDFs via PdfWriter.append() and writing the output. [2](https://bing.com/search?q=material+for+mkdocs+custom+404+page+setup)[3](https://squidfunk.github.io/mkdocs-material/customization/)
58
+
59
+
- name: Upload release assets (keep ALL artefacts)
test -f "${{ env.EXPORT_DIR }}/${{ env.BASENAME }}.pdf"
41
+
test -f "${{ env.EXPORT_DIR }}/${{ env.BASENAME }}.docx"
42
+
43
+
- name: Merge cover + body PDF (create additional artifact)
44
+
run: |
45
+
python -m pip install --upgrade pip
46
+
python -m pip install pypdf
47
+
python - <<'PY'
48
+
from pypdf import PdfWriter
49
+
50
+
cover = "assets/cover.pdf"
51
+
body = "${{ env.EXPORT_DIR }}/${{ env.BASENAME }}.pdf"
52
+
out = "${{ env.EXPORT_DIR }}/${{ env.BASENAME }}-with-cover.pdf"
53
+
54
+
writer = PdfWriter()
55
+
writer.append(cover) # cover can be 1 or multiple pages
56
+
writer.append(body)
57
+
writer.write(out)
58
+
print(f"Created {out}")
59
+
PY
60
+
# pypdf merges PDFs by appending inputs with PdfWriter.append() and writing output. [2](https://bing.com/search?q=material+for+mkdocs+custom+404+page+setup)
61
+
62
+
- name: Upload release assets (keep ALL artifacts)
0 commit comments