An open API service indexing awesome lists of open source software.

https://github.com/otthe/qr-pdf

Ruby library to generate and add QR codes to PDF documents
https://github.com/otthe/qr-pdf

automation pdf qrcode-generator ruby

Last synced: 7 months ago
JSON representation

Ruby library to generate and add QR codes to PDF documents

Awesome Lists containing this project

README

          

# QR-PDF
Dynamically generates and adds QR code to one of the four corners of your one page PDF.

Generated PDF will be saved into a new folder with the same name as the input file.

## Position options
You can choose which corner the QR code will be placed via following strings:
```
"top-left" || "top-right" || "bottom-left" || "bottom-right"
```

## CLI Usage
```
# With default size
ruby qrpdf.rb --url "https://example.com" --corner "bottom-right" --filename "test.pdf" --output "tmp"

# With optional size
ruby qrpdf.rb --url "https://example.com" --corner "bottom-right" --filename "test.pdf" --output "tmp" --size 96
```

## Library Usage
```
require_relative 'lib/QRPdf'

qr_url = "https://example.com"
corner = "top-left"
filename = "test.pdf"
output_folder = "tmp"
size = 96

doc = QRPdf::Document.new(
qr_url,
corner,
filename,
output_folder,
size
)

doc.execute

```

## Things to consider
* This library only supports one page PDF's for now (although you can easily modify this for your needs)

* No tests currently