Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
Improve description of output formats.
  • Loading branch information
sorairolake committed Jul 10, 2024
1 parent 2bb143a commit 4d9553d
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 4 deletions.
21 changes: 19 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,12 @@ Output:
QR code
```

### SVG generation
### Output formats

Use `-t` option to change the format of the generated image. The format is
`png` (default), `svg` or `terminal` (to the terminal as UTF-8 string).
`pic`, `png` (default), `svg` or `terminal` (to the terminal as UTF-8 string).

Encode to a SVG image:

```sh
qrtool encode -o output.svg -t svg "QR code"
Expand All @@ -82,6 +84,21 @@ Generate this image:

![Output](tests/data/decode/decode.svg)

Output to the terminal as UTF-8 string:

```sh
qrtool encode -t terminal "QR code"
```

Generate a PDF file from the PIC code:

```sh
qrtool encode -t pic "QR code" \
| awk 'BEGIN { print ".vs 0\n.po 0\n.PS" } END { print "scale = 25.4 * 3\n.PE" } { print }' \
| groff -Tpdf -p -P-p3i,3i \
> output.pdf
```

### Micro QR code generation

Use `--variant` option to change the variant of the generated QR code. The
Expand Down
20 changes: 18 additions & 2 deletions docs/book/modules/ROOT/pages/usage.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,12 @@ qrtool decode output.png
QR code
....

== SVG generation
== Output formats

Use `-t` option to change the format of the generated image. The format is
`png` (default), `svg` or `terminal` (to the terminal as UTF-8 string).
`pic`, `png` (default), `svg` or `terminal` (to the terminal as UTF-8 string).

.Encode to a SVG image
[source,sh]
----
qrtool encode -o output.svg -t svg "QR code"
Expand All @@ -62,6 +63,21 @@ qrtool encode -o output.svg -t svg "QR code"
.Generate this image
image::decode.svg[Output]

.Output to the terminal as UTF-8 string
[source,sh]
----
qrtool encode -t terminal "QR code"
----

.Generate a PDF file from the PIC code
[source,sh]
----
qrtool encode -t pic "QR code" \
| awk 'BEGIN { print ".vs 0\n.po 0\n.PS" } END { print "scale = 25.4 * 3\n.PE" } { print }' \
| groff -Tpdf -p -P-p3i,3i \
> output.pdf
----

== Micro QR code generation

Use `--variant` option to change the variant of the generated QR code. The
Expand Down

0 comments on commit 4d9553d

Please sign in to comment.