Added image downsampling/compression
All checks were successful
Build PDF / make pdf (push) Successful in 6m1s

This commit is contained in:
2026-07-04 17:46:27 -07:00
parent 5ac61941c6
commit 25afbf036e
6 changed files with 766 additions and 139 deletions

View File

@@ -27,6 +27,8 @@ serve: deps
PDF := $(OUT_DIR)/output.pdf
PDF_2UP := $(OUT_DIR)/output-2up.pdf
PDF_IMAGE_DPI ?= 144
PDF_JPEG_QUALITY ?= 75
.PHONY: deps
deps:
@@ -35,13 +37,12 @@ deps:
.PHONY: pdf
pdf: build deps
@echo "Generating PDF by rendering each page and merging..."
@$(GO) run ./cmd/pdfbook --pages $(OUT_DIR) --order pages.yaml --out $(PDF)
@$(GO) run ./cmd/pdfbook --pages $(OUT_DIR) --order pages.yaml --out $(PDF) --image-dpi $(PDF_IMAGE_DPI) --jpeg-quality $(PDF_JPEG_QUALITY)
.PHONY: pdf-2up
pdf-2up: build deps
@echo "Generating 2-up PDF with headless Chrome..."
@$(GO) run ./cmd/pdf --in $(OUT_DIR)/print_2up.html --out $(PDF_2UP) --w 11 --h 8.5
@$(GO) run ./cmd/pdf --in $(OUT_DIR)/print_2up.html --out $(PDF_2UP) --w 11 --h 8.5 --image-dpi $(PDF_IMAGE_DPI) --jpeg-quality $(PDF_JPEG_QUALITY)
clean:
rm -rf $(OUT_DIR) index.html