about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPatryk Niedźwiedziński <pniedzwiedzinski19@gmail.com>2021-06-21 14:58:06 +0200
committerPatryk Niedźwiedziński <pniedzwiedzinski19@gmail.com>2021-06-21 14:58:06 +0200
commit13621463f4339ac4eb7683664fbb4e4513beadfa (patch)
tree84c88f878cee3b98f9ea441f6852e4f9732a3b73
parentc429bd2f143c3bd2a86fcc09523dcaf6df17c63e (diff)
downloadspiewnik-trakt-13621463f4339ac4eb7683664fbb4e4513beadfa.tar.gz
spiewnik-trakt-13621463f4339ac4eb7683664fbb4e4513beadfa.zip
Akordy
-rw-r--r--.gitignore8
-rw-r--r--akordy.do1
-rw-r--r--akordy1.xcfbin0 -> 1780130 bytes
-rw-r--r--akordy2.xcfbin0 -> 1854158 bytes
-rwxr-xr-xbin/xcf-to-pdf23
-rw-r--r--print.do5
6 files changed, 34 insertions, 3 deletions
diff --git a/.gitignore b/.gitignore
index 9d78a49..07406d3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,11 @@
 .redo
-spiewnik-book.pdf
+
+akordy1.pdf
+akordy2.pdf
+
+spiewnik-all.pdf
+spiewnik-all-book.pdf
+
 spiewnik.pdf
 spiewnik.ps
 spiewnik.idx
diff --git a/akordy.do b/akordy.do
new file mode 100644
index 0000000..98e45ca
--- /dev/null
+++ b/akordy.do
@@ -0,0 +1 @@
+./bin/xcf-to-pdf akordy1.xcf akordy2.xcf 1> /dev/stderr
diff --git a/akordy1.xcf b/akordy1.xcf
new file mode 100644
index 0000000..8bdcf12
--- /dev/null
+++ b/akordy1.xcf
Binary files differdiff --git a/akordy2.xcf b/akordy2.xcf
new file mode 100644
index 0000000..2632ca3
--- /dev/null
+++ b/akordy2.xcf
Binary files differdiff --git a/bin/xcf-to-pdf b/bin/xcf-to-pdf
new file mode 100755
index 0000000..34da9c8
--- /dev/null
+++ b/bin/xcf-to-pdf
@@ -0,0 +1,23 @@
+#!/bin/sh
+{
+cat <<EOF
+(define (convert-xcf-to-pdf filename outfile)
+  (let* (
+     (image (car (gimp-file-load RUN-NONINTERACTIVE filename filename)))
+     (drawable (car (gimp-image-merge-visible-layers image CLIP-TO-IMAGE)))
+     )
+    (file-pdf-save RUN-NONINTERACTIVE image drawable outfile outfile TRUE TRUE TRUE)
+    (gimp-image-delete image) ; ... or the memory will explode
+    )
+)
+
+(gimp-message-set-handler 1) ; Messages to standard output
+EOF
+
+for i in $*; do
+  echo "(gimp-message \"$i\")"
+  echo "(convert-xcf-to-pdf \"$i\" \"${i%%.xcf}.pdf\")"
+done
+
+echo "(gimp-quit 0)"
+} | gimp -i -b -
diff --git a/print.do b/print.do
index 92b1c97..d662d1c 100644
--- a/print.do
+++ b/print.do
@@ -1,2 +1,3 @@
-redo-ifchange spiewnik.pdf
-pdfbook2 --paper=a4paper -s --inner-margin=100 spiewnik.pdf 1> /dev/null
+redo-ifchange spiewnik.pdf akordy
+pdfunite spiewnik.pdf akordy1.pdf akordy2.pdf spiewnik-all.pdf
+pdfbook2 --paper=a4paper -s --inner-margin=100 spiewnik-all.pdf 1> /dev/null