Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mi 5/qr code customization options #487

Merged
merged 5 commits into from
May 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 28 additions & 5 deletions shared/models/qr_code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,52 @@ properties:
description: Sets how a QR code is being positioned in the document. Together with this, you should provide one of 'top' or 'bottom', and one of 'left' or 'right'.

top:
type: string
type: number
description: Vertical distance (in inches) to place QR code from the top. Only allowed if "bottom" isn't provided.

right:
type: string
type: number
description: Horizontal distance (in inches) to place QR code from the right. Only allowed if "left" isn't provided.

left:
type: string
type: number
description: Horizontal distance (in inches) to place QR code from the left. Only allowed if "right" isn't provided.

bottom:
type: string
type: number
description: Vertical distance (in inches) to place QR code from the bottom. Only allowed if "top" isn't provided.

redirect_url:
type: string
description: The url to redirect the user when a QR code is scanned. The url must start with `https://`

width:
type: string
type: number
description: The size (in inches) of the QR code with a minimum of 1 inch. All QR codes are generated as a square.

pages:
type: string
description: Specify the pages where the QR code should be stamped in a comma separated format. Your QR code can be printed in the same position on multiple pages. For postcards, the values should either be "front", "back" (for either front or back) or "front,back" (for the QR code to be printed on both sides). For self-mailers, the values should either be "inside", "outside" (for either inside or outside) or "inside,outside" (for the QR code to be printed on both sides). For letters, the values can be specific page numbers ("1", "3"), page number ranges such as "1-3", or a comma separated combination of both ("1,3,5-7").

logo:
type: object
description: Allows specifying a logo to be placed over the center of the QR code. Logos must be in PNG or JPEG format and have a maximum file size of 1 MB.
properties:
url:
type: string
description: The public URL of the logo image to be retrieved and placed over the center of the QR code.
pattern: "^https://[-a-zA-Z0-9@:%._+~#=/]{1,256}.(png|jpe?g)$"

style:
type: object
description: Customizes the appearance of the QR code.
properties:
background_color:
type: string
description: The background color of the QR code in hexadecimal format. For example, `#000000` is black and `#FFFFFF` is white.
pattern: "^#[A-Fa-f0-9]{6}$"

foreground_color:
type: string
description: The foreground color of the QR code in hexadecimal format. For example, `#000000` is black and `#FFFFFF` is white.
pattern: "^#[A-Fa-f0-9]{6}$"
Loading