diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 2bae19e..ed2e408 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,11 +1,6 @@ FROM docker.io/ldericher/autodoc:diagram RUN set -ex; \ - # install pdfa tools - ln -s \ - /workspaces/lev-templates/deploy/pdfa \ - /opt/ \ - ; \ # install TeXoffice ln -s \ /workspaces/lev-templates/deploy/texoffice \ diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 1a8486e..2297bb8 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -13,7 +13,7 @@ "configureZshAsDefaultShell": "true" }, "ghcr.io/devcontainers/features/git:1": {}, - "ghcr.io/devcontainers-contrib/features/git-lfs:1": {}, + "ghcr.io/devcontainers/features/git-lfs:1": {}, "ghcr.io/devcontainers-extra/features/apt-get-packages:1": { "packages": "pdftk,poppler-utils" } @@ -22,7 +22,8 @@ // Ensure git is installed before git-lfs "overrideFeatureInstallOrder": [ "ghcr.io/devcontainers/features/common-utils", - "ghcr.io/devcontainers/features/git" + "ghcr.io/devcontainers/features/git", + "ghcr.io/devcontainers/features/git-lfs" ], // Configure tool-specific properties. diff --git a/.gitattributes b/.gitattributes index b790950..4952350 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,3 +1,2 @@ -deploy/pdfa/bin/* filter=lfs diff=lfs merge=lfs -text *.pdf filter=lfs diff=lfs merge=lfs -text -*.png filter=lfs diff=lfs merge=lfs -text \ No newline at end of file +*.png filter=lfs diff=lfs merge=lfs -text diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 7d3c485..0c1d216 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -3,6 +3,7 @@ "tomoki1207.pdf" ], "unwantedRecommendations": [ + "ms-azuretools.vscode-containers", "ms-vscode.makefile-tools" ] } diff --git a/Dockerfile b/Dockerfile index 7e9940a..1a2a8f5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,4 @@ -FROM docker.io/ldericher/autodoc:0.8-diagram - -# install pdfa tools as per https://stackoverflow.com/a/39420880 -COPY --chown=root:root \ - deploy/pdfa \ - /opt/pdfa +FROM docker.io/ldericher/autodoc:diagram # install TeXoffice COPY --chown=root:root \ diff --git a/deploy/pdfa/PDFA_def.ps b/deploy/pdfa/PDFA_def.ps deleted file mode 100644 index 158cf3f..0000000 --- a/deploy/pdfa/PDFA_def.ps +++ /dev/null @@ -1,39 +0,0 @@ -%! -% This prefix file for creating a PDF/A document is derived from -% the sample included with Ghostscript 9.07, released under the -% GNU Affero General Public License. -% Modified 4/15/2013 by MCB Systems. - -% Feel free to modify entries marked with "Customize". - -% This assumes an ICC profile to reside in the file (AdobeRGB1998.icc), -% unless the user modifies the corresponding line below. - -% The color space described by the ICC profile must correspond to the -% ProcessColorModel specified when using this prefix file (GRAY with -% DeviceGray, RGB with DeviceRGB, and CMYK with DeviceCMYK). - -% Define entries in the document Info dictionary : - -/ICCProfile (/opt/pdfa/bin/AdobeRGB1998.icc) % Customize. -def - -[ /Title (Title) % Customize. - /DOCINFO pdfmark - -% Define an ICC profile : - -[/_objdef {icc_PDFA} /type /stream /OBJ pdfmark -[{icc_PDFA} <> /PUT pdfmark -[{icc_PDFA} ICCProfile (r) file /PUT pdfmark - -% Define the output intent dictionary : - -[/_objdef {OutputIntent_PDFA} /type /dict /OBJ pdfmark -[{OutputIntent_PDFA} << - /Type /OutputIntent % Must be so (the standard requires). - /S /GTS_PDFA1 % Must be so (the standard requires). - /DestOutputProfile {icc_PDFA} % Must be so (see above). - /OutputConditionIdentifier (default_rgb) % Customize ->> /PUT pdfmark -[{Catalog} <> /PUT pdfmark \ No newline at end of file diff --git a/deploy/pdfa/bin/AdobeRGB1998.icc b/deploy/pdfa/bin/AdobeRGB1998.icc deleted file mode 100644 index 647df8a..0000000 --- a/deploy/pdfa/bin/AdobeRGB1998.icc +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:304f569a83c1e5eddaddac54e99ed03339333db013738bb499ab64f049887e28 -size 560 diff --git a/deploy/pdfa/bin/gs-919-linux_x86_64 b/deploy/pdfa/bin/gs-919-linux_x86_64 deleted file mode 100755 index d713181..0000000 --- a/deploy/pdfa/bin/gs-919-linux_x86_64 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:5de34d3ad386a3998d29d0d4e59ef6620f8fac637587f3840601455dc596a6aa -size 17983531 diff --git a/src/lenaisten/compile-md.mk b/src/lenaisten/compile-md.mk index 814a836..a48cfcc 100644 --- a/src/lenaisten/compile-md.mk +++ b/src/lenaisten/compile-md.mk @@ -1,3 +1,5 @@ +include /usr/local/share/autodoc/pdftools.mk + # compile markdown using pandoc # params: # 1: input file @@ -14,40 +16,6 @@ compile_md = pandoc \ $(PANDOCFLAGS) \ --output $(4) -GSFLAGS := \ - -sDEVICE=pdfwrite \ - -dNOOUTERSAVE \ - -dNOPAUSE \ - -dQUIET \ - -dBATCH - -# post-process and compress PDF files -# params: -# 1: input file -# 2: output file -postprocess_pdf = gs \ - $(GSFLAGS) \ - -sPAPERSIZE=a4 \ - -dFIXEDMEDIA \ - -dPDFFitPage \ - -dCompatibilityLevel=1.7 \ - -dPDFSETTINGS=/ebook \ - -sOutputFile=$(2) \ - $(1) - -# convert PDF to PDF/A 2-b -# params: -# 1: input file -# 2: output file -convert_pdfa = /opt/pdfa/bin/gs-919-linux_x86_64 \ - $(GSFLAGS) \ - -dPDFA=2 \ - -sProcessColorModel=DeviceRGB \ - -dPDFACompatibilityPolicy=1 \ - -sOutputFile=$(2) \ - /opt/pdfa/PDFA_def.ps \ - $(1) - # convert markdown to LaTeX # params: # 1: input file @@ -60,10 +28,10 @@ md2tex = $(call compile_md,$(1),$(2),latex,$(3)) # 1: input file # 2: pandoc template # 3: output file -md2pdf = $(call compile_md,$(1),$(2),pdf,-) | $(call postprocess_pdf,-,$(3)) +md2pdf = $(call compile_md,$(1),$(2),pdf,-) | $(call pdftools_pdfcat,-,$(3)) # convert markdown to PDF/A 2-b # 1: input file # 2: pandoc template # 3: output file -md2pdfa = $(call md2pdf,$(1),$(2),-) | $(call convert_pdfa,-,$(3)) +md2pdfa = $(call md2pdf,$(1),$(2),-) | $(call pdftools_mkpdfa,3,-,$(3))