From 7c8b99d7a19c147d4700cbdf3d43f4236867e1c1 Mon Sep 17 00:00:00 2001 From: orensbruli Date: Sun, 14 Jan 2024 12:54:54 +0100 Subject: [PATCH] Fix compression --- .github/workflows/github_action_build.yml | 5 +---- Makefile | 8 +++++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/github_action_build.yml b/.github/workflows/github_action_build.yml index 3cf68e3..3f607c6 100644 --- a/.github/workflows/github_action_build.yml +++ b/.github/workflows/github_action_build.yml @@ -37,10 +37,7 @@ jobs: run: docker run -v $(pwd):/latex_content --name latex-container latex-build /bin/sh -c "make pdf" - name: Copy PDF from Docker Container - run: docker cp latex-container:/latex_content/rendered.pdf output_uncompressed.pdf - - - name: compress pdf - run: gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.5 -dPDFSETTINGS=/ebook -dNOPAUSE -dQUIET -dBATCH -dPrinted=false -sOutputFile=output.pdf output_uncompressed.pdf + run: docker cp latex-container:/latex_content/rendered.pdf output.pdf - name: Upload PDF as Artifact uses: actions/upload-artifact@v4 diff --git a/Makefile b/Makefile index 911f12c..af8219e 100644 --- a/Makefile +++ b/Makefile @@ -2,8 +2,9 @@ SHELL = /bin/sh FILE0 = main TEX_TEMPLATE = $(FILE0).template.tex -TEX = $(FILE0).tex +TEX = $(FILE0).raw.tex PDF = $(FILE0).pdf +RAW_PDF = $(FILE0).raw.pdf all: pdf @@ -16,8 +17,9 @@ pdf: cd build/pdf/; \ pandoc data.md --pdf-engine xelatex --template sidebar.template.tex -o sidebar.tex ; \ pandoc data.md --pdf-engine xelatex --template $(TEX_TEMPLATE) -o $(TEX) ; \ - xelatex -shell-escape -output-driver="xdvipdfmx -z 0" $(TEX) - + xelatex -shell-escape -output-driver="xdvipdfmx -z 0" $(TEX) ; \ + echo "Compresing PDF..."; \ + gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.5 -dPDFSETTINGS=/ebook -dNOPAUSE -dQUIET -dBATCH -dPrinted=false -sOutputFile=$(PDF) $(RAW_PDF) cp build/pdf/$(PDF) ./rendered.pdf clean-pdf: