Skip to content

Commit

Permalink
Include node title as title of PDF
Browse files Browse the repository at this point in the history
  • Loading branch information
joecorall authored Oct 17, 2024
1 parent 6feecd0 commit 9c9341a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion examples/mergepdf/cmd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ curl -s "$1/book-manifest" | jq -r '.sequences[0].canvases[].images[0].resource.
I="$(( I + 1))"
done

# Make the node title the title of the PDF
TITLE=$(curl -L "$1?_format=json" | jq -r '.title[0].value')
echo "[ /Title ($TITLE)/DOCINFO pdfmark" > "$TMP_DIR/metadata.txt"

mapfile -t FILES < <(ls -rt "$TMP_DIR"/img_*.pdf)
gs -dBATCH \
-dNOPAUSE \
Expand All @@ -25,7 +29,8 @@ gs -dBATCH \
-dNOOUTERSAVE \
-dAutoRotatePages=/None \
-sOutputFile="$TMP_DIR/ocr.pdf" \
"${FILES[@]}"
"${FILES[@]}" \
"$TMP_DIR/metadata.txt"

# Instead of printing the PDF
# PUT it to the endpoint
Expand Down

0 comments on commit 9c9341a

Please sign in to comment.