Skip to content

Commit

Permalink
Fix compression
Browse files Browse the repository at this point in the history
  • Loading branch information
orensbruli committed Jan 14, 2024
1 parent 457f93a commit 7c8b99d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/github_action_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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:
Expand Down

0 comments on commit 7c8b99d

Please sign in to comment.