Add pdf-invoice module: one invoice in OpenPDF 3.0.5, iText Core 9.8.0 and Flying Saucer 10.7.0, Devanagari shaping checked by rendering, streamed vs buffered download, subset sizes and timings
Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017ic4b6Kg9RWSTJzyz6KP9X
This commit is contained in:
Executable
+35
@@ -0,0 +1,35 @@
|
||||
#!/usr/bin/env bash
|
||||
# Licence facts, read from the sources at run time: Maven POMs and the iText licence page.
|
||||
set -u
|
||||
echo "# licences as declared in the POMs Maven downloaded (~/.m2) and in the pdfCalligraph POM on iText's own repository, fetched $(date -u +%F)"
|
||||
M2="${HOME}/.m2/repository"
|
||||
lic() { grep -A1 '<license>' "$1" | grep '<name>' | sed 's/^ *<name>//; s#</name>##' | tr '\n' ';'; }
|
||||
echo "openpdf 3.0.5 (declared in openpdf-parent): $(lic "$M2/com/github/librepdf/openpdf-parent/3.0.5/openpdf-parent-3.0.5.pom")"
|
||||
echo "itext kernel/layout 9.8.0 (root pom): $(lic "$M2/com/itextpdf/root/9.8.0/root-9.8.0.pom")"
|
||||
echo "flying-saucer-pdf 10.7.0 (flying-saucer-parent): $(lic "$M2/org/xhtmlrenderer/flying-saucer-parent/10.7.0/flying-saucer-parent-10.7.0.pom")"
|
||||
pom() { curl -s --retry 3 "$1" | grep -A2 '<license>' | grep -E '<name>' | sed 's/^ *<name>//; s#</name>##' | tr '\n' ';'; }
|
||||
echo "typography (pdfCalligraph) 5.1.1: $(pom https://repo.itextsupport.com/releases/com/itextpdf/typography/5.1.1/typography-5.1.1.pom | tr '\n' ' ')"
|
||||
echo
|
||||
echo "# sentences from https://itextpdf.com/how-buy/agpl-license (verbatim, page text with tags stripped)"
|
||||
curl -sL https://itextpdf.com/how-buy/agpl-license | python3 -c '
|
||||
import re, sys, html
|
||||
t = sys.stdin.read()
|
||||
t = re.sub(r"<script.*?</script>|<style.*?</style>", "", t, flags=re.S)
|
||||
t = html.unescape(re.sub(r"<[^>]+>", "\n", t))
|
||||
keys = ("dual-licensed", "AGPLv3 license. This license applies", "You may not deploy it on a network", "Producer", "producer line",
|
||||
"violation to use", "release you from the AGPLv3")
|
||||
seen = set()
|
||||
for line in (l.strip() for l in t.split("\n")):
|
||||
if any(k in line for k in keys) and line not in seen and len(line) > 40:
|
||||
seen.add(line); print("- " + line)
|
||||
'
|
||||
echo
|
||||
echo "# versions: latest GA per maven-metadata.xml"
|
||||
for a in com/github/librepdf/openpdf com/itextpdf/kernel org/xhtmlrenderer/flying-saucer-pdf org/xhtmlrenderer/flying-saucer-pdf-openpdf org/apache/pdfbox/pdfbox; do
|
||||
v=""
|
||||
for _ in 1 2 3 4 5 6; do # Maven Central answers 429 now and then
|
||||
v="$(curl -s https://repo1.maven.org/maven2/$a/maven-metadata.xml | tr '<' '\n' | grep -E '^(release|latest)>' | head -1 | sed 's/>/ /')"
|
||||
[ -n "$v" ] && break; sleep 15
|
||||
done
|
||||
printf '%-45s %s\n' "$a" "${v:-(rate limited, not read)}"
|
||||
done
|
||||
Reference in New Issue
Block a user