Merge tag 'v0.9.0' into develop

add "pdftools.mk" GNU Make library and tooling
This commit is contained in:
Jörn-Michael Miehe 2025-10-02 14:11:22 +02:00
commit b3f6d6f938
7 changed files with 77 additions and 4 deletions

1
.gitattributes vendored Normal file
View file

@ -0,0 +1 @@
*.icc filter=lfs diff=lfs merge=lfs -text

View file

@ -7,6 +7,7 @@ RUN set -ex; \
ghostscript \
inotify-tools \
make \
patch \
; \
\
tlmgr update --self; \
@ -20,6 +21,12 @@ RUN set -ex; \
COPY src/usr /usr
RUN set -ex; \
\
cp /usr/share/ghostscript/lib/PDFA_def.ps /usr/local/share/autodoc/; \
patch -d /usr/local/share/autodoc < /usr/local/share/autodoc/PDFA_def.ps.patch; \
rm /usr/local/share/autodoc/PDFA_def.ps.patch;
WORKDIR /docs
ENTRYPOINT ["autodoc"]
CMD ["-bw"]
@ -37,7 +44,6 @@ RUN set -ex; \
apk add --no-cache \
chromium \
npm \
patch \
; \
\
npm install --global @mermaid-js/mermaid-cli; \

View file

@ -8,6 +8,7 @@ RUN set -ex; \
ghostscript \
inotify-tools \
make \
patch \
; rm -rf /var/lib/apt/lists/*; \
\
tlmgr update --self; \
@ -21,6 +22,12 @@ RUN set -ex; \
COPY src/usr /usr
RUN set -ex; \
\
cp /usr/share/ghostscript/10.02.1/lib/PDFA_def.ps /usr/local/share/autodoc/; \
patch -d /usr/local/share/autodoc < /usr/local/share/autodoc/PDFA_def.ps.patch; \
rm /usr/local/share/autodoc/PDFA_def.ps.patch;
WORKDIR /docs
ENTRYPOINT ["autodoc"]
CMD ["-bw"]
@ -45,7 +52,6 @@ RUN set -ex; \
libxkbcommon0 \
libxrandr2 \
npm \
patch \
; rm -rf /var/lib/apt/lists/*; \
\
npm install --global @mermaid-js/mermaid-cli; \

View file

@ -1,5 +1,5 @@
--- diagram.lua 2024-11-18 23:55:02.673989033 +0100
+++ diagram.patched.lua 2024-11-19 00:10:14.359878550 +0100
--- diagram.lua
+++ diagram.lua
@@ -158,7 +158,7 @@
write_file(infile, code)
pipe(

View file

@ -0,0 +1,11 @@
--- PDFA_def.ps
+++ PDFA_def.ps
@@ -9,7 +9,7 @@
/DOCINFO pdfmark
% Define an ICC profile :
-/ICCProfile (srgb.icc) % Customise
+/ICCProfile (/usr/local/share/autodoc/compatibleWithAdobeRGB1998.icc) % Customise
def
[/_objdef {icc_PDFA} /type /stream /OBJ pdfmark

BIN
src/usr/local/share/autodoc/compatibleWithAdobeRGB1998.icc (Stored with Git LFS) Normal file

Binary file not shown.

View file

@ -0,0 +1,46 @@
#############
# FUNCTIONS #
#############
PDFTOOLS_GSFLAGS := \
-sDEVICE=pdfwrite \
-dNOOUTERSAVE \
-dNOPAUSE \
-dQUIET \
-dBATCH
pdftools_pdfcat = gs \
$(PDFTOOLS_GSFLAGS) \
-sPAPERSIZE=a4 \
-dFIXEDMEDIA \
-dPDFFitPage \
-dCompatibilityLevel=1.7 \
-dPDFSETTINGS=/ebook \
-sOutputFile=$(2) \
$(1)
pdftools_mkpdfa = gs \
$(PDFTOOLS_GSFLAGS) \
-dPDFA=$(1) \
-sColorConversionStrategy=RGB \
-dPDFACompatibilityPolicy=1 \
--permit-file-read=/usr/local/share/autodoc/ \
-sOutputFile=$(3) \
/opt/pdfa/PDFA_def.ps \
$(2)
############
# PATTERNS #
############
# convert PDF to PDF/A-2B
%_pdfa2.pdf: %.pdf
$(call convert_pdfa,2,$<,$@)
# convert PDF to PDF/A-3B
%_pdfa3.pdf: %.pdf
$(call convert_pdfa,3,$<,$@)
# convert PDF to PDF/A (default variant 3B)
%_pdfa.pdf: %.pdf
$(call convert_pdfa,3,$<,$@)