-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path03-verbose-pages.sh
More file actions
36 lines (30 loc) · 928 Bytes
/
Copy path03-verbose-pages.sh
File metadata and controls
36 lines (30 loc) · 928 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/env bash
# inspect/03-verbose-pages.sh — deep inspection with --verbose and --pages
#
# Prerequisites:
# - pdfnative-cli installed globally
#
# Usage:
# bash samples/inspect/03-verbose-pages.sh
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
ROOT_DIR="$(cd "$SCRIPT_DIR/../.." && pwd)"
OUTPUT_DIR="$ROOT_DIR/samples/output"
PDF="$OUTPUT_DIR/document/03-all-blocks.pdf"
INSPECT_OUT="$OUTPUT_DIR/inspect"
mkdir -p "$INSPECT_OUT"
if [ ! -f "$PDF" ]; then
echo "→ Rendering source document…"
mkdir -p "$OUTPUT_DIR/document"
pdfnative render \
--input "$ROOT_DIR/samples/render/document/03-all-blocks.json" \
--output "$PDF"
fi
echo "→ Inspecting (verbose + pages)…"
pdfnative inspect \
--input "$PDF" \
--format json \
--verbose \
--pages \
--output "$INSPECT_OUT/03-verbose-pages.json"
echo " ✓ Report: $INSPECT_OUT/03-verbose-pages.json"