Configuration-settings.md.txt 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453
  1. # Configuration settings
  2. <!-- This file is auto generated from the source of QROptions.php -->
  3. ## version
  4. QR Code version number
  5. `1 ... 40` or `Version::AUTO` (default)
  6. **See also:**
  7. - `\chillerlan\QRCode\Common\Version`
  8. ## versionMin
  9. Minimum QR version
  10. if `QROptions::$version` is set to `Version::AUTO` (default: 1)
  11. ## versionMax
  12. Maximum QR version
  13. if `QROptions::$version` is set to `Version::AUTO` (default: 40)
  14. ## eccLevel
  15. Error correct level
  16. the constant `EccLevel::X` where `X` is:
  17. - `L` => 7% (default)
  18. - `M` => 15%
  19. - `Q` => 25%
  20. - `H` => 30%
  21. alternatively you can just pass the letters L/M/Q/H (case-insensitive) to the magic setter
  22. **See also:**
  23. - `\chillerlan\QRCode\Common\EccLevel`
  24. - [github.com/chillerlan/php-qrcode/discussions/160](https://github.com/chillerlan/php-qrcode/discussions/160)
  25. ## maskPattern
  26. Mask Pattern to use (no value in using, mostly for unit testing purposes)
  27. `0 ... 7` or `MaskPattern::PATTERN_AUTO` (default)
  28. **See also:**
  29. - `\chillerlan\QRCode\Common\MaskPattern`
  30. ## addQuietzone
  31. Add a "quiet zone" (margin) according to the QR code spec
  32. **See also:**
  33. - [www.qrcode.com/en/howto/code.html](https://www.qrcode.com/en/howto/code.html)
  34. ## quietzoneSize
  35. Size of the quiet zone
  36. internally clamped to `0 ... $moduleCount / 2` (default: 4)
  37. ## outputInterface
  38. The FQCN of the `QROutputInterface` to use
  39. ## returnResource
  40. Return the image resource instead of a render if applicable.
  41. - `QRGdImage`: `resource` (PHP < 8), `GdImage`
  42. - `QRImagick`: `Imagick`
  43. - `QRFpdf`: `FPDF`
  44. This option overrides/ignores other output settings, such as `QROptions::$cachefile`
  45. and `QROptions::$outputBase64`. (default: `false`)
  46. **See also:**
  47. - `\chillerlan\QRCode\Output\QROutputInterface::dump()`
  48. ## cachefile
  49. Optional cache file path `/path/to/cache.file`
  50. Please note that the `$file` parameter in `QRCode::render()` and `QRCode::renderMatrix()`
  51. takes precedence over the `QROptions::$cachefile` value. (default: `null`)
  52. **See also:**
  53. - `\chillerlan\QRCode\QRCode::render()`
  54. - `\chillerlan\QRCode\QRCode::renderMatrix()`
  55. ## outputBase64
  56. Toggle base64 data URI or raw data output (if applicable)
  57. (default: `true`)
  58. **See also:**
  59. - `\chillerlan\QRCode\Output\QROutputAbstract::toBase64DataURI()`
  60. ## eol
  61. Newline string
  62. (default: `PHP_EOL`)
  63. ## bgColor
  64. Sets the image background color (if applicable)
  65. - `QRImagick`: defaults to `"white"`
  66. - `QRGdImage`: defaults to `[255, 255, 255]`
  67. - `QRFpdf`: defaults to blank internally (white page)
  68. ## invertMatrix
  69. Whether to invert the matrix (reflectance reversal)
  70. (default: `false`)
  71. **See also:**
  72. - `\chillerlan\QRCode\Data\QRMatrix::invert()`
  73. ## drawLightModules
  74. Whether to draw the light (false) modules
  75. (default: `true`)
  76. ## drawCircularModules
  77. Specify whether to draw the modules as filled circles
  78. a note for `GdImage` output:
  79. if `QROptions::$scale` is less than 20, the image will be upscaled internally, then the modules will be drawn
  80. using `imagefilledellipse()` and then scaled back to the expected size
  81. No effect in: `QREps`, `QRFpdf`, `QRMarkupHTML`
  82. **See also:**
  83. - [php.net: `\imagefilledellipse()`](https://www.php.net/manual/function.imagefilledellipse)
  84. - [github.com/chillerlan/php-qrcode/issues/23](https://github.com/chillerlan/php-qrcode/issues/23)
  85. - [github.com/chillerlan/php-qrcode/discussions/122](https://github.com/chillerlan/php-qrcode/discussions/122)
  86. ## circleRadius
  87. Specifies the radius of the modules when `QROptions::$drawCircularModules` is set to `true`
  88. (default: 0.45)
  89. ## keepAsSquare
  90. Specifies which module types to exclude when `QROptions::$drawCircularModules` is set to `true`
  91. (default: `[]`)
  92. ## connectPaths
  93. Whether to connect the paths for the several module types to avoid weird glitches when using gradients etc.
  94. This option is exclusive to output classes that use the module collector `QROutputAbstract::collectModules()`,
  95. which converts the `$M_TYPE` of all modules to `QRMatrix::M_DATA` and `QRMatrix::M_DATA_DARK` respectively.
  96. Module types that should not be added to the connected path can be excluded via `QROptions::$excludeFromConnect`.
  97. Currentty used in `QREps` and `QRMarkupSVG`.
  98. **See also:**
  99. - `\chillerlan\QRCode\Output\QROutputAbstract::collectModules()`
  100. - `\chillerlan\QRCode\QROptionsTrait::$excludeFromConnect`
  101. - [github.com/chillerlan/php-qrcode/issues/57](https://github.com/chillerlan/php-qrcode/issues/57)
  102. ## excludeFromConnect
  103. Specify which paths/patterns to exclude from connecting if `QROptions::$connectPaths` is set to `true`
  104. **See also:**
  105. - `\chillerlan\QRCode\QROptionsTrait::$connectPaths`
  106. ## moduleValues
  107. Module values map
  108. - `QRImagick`, `QRMarkupHTML`, `QRMarkupSVG`: #ABCDEF, cssname, rgb(), rgba()...
  109. - `QREps`, `QRFpdf`, `QRGdImage`: `[R, G, B]` // 0-255
  110. - `QREps`: `[C, M, Y, K]` // 0-255
  111. **See also:**
  112. - `\chillerlan\QRCode\Output\QROutputAbstract::setModuleValues()`
  113. ## addLogoSpace
  114. Toggles logo space creation
  115. **See also:**
  116. - `\chillerlan\QRCode\QRCode::addMatrixModifications()`
  117. - `\chillerlan\QRCode\Data\QRMatrix::setLogoSpace()`
  118. ## logoSpaceWidth
  119. Width of the logo space
  120. if only `QROptions::$logoSpaceWidth` is given, the logo space is assumed a square of that size
  121. ## logoSpaceHeight
  122. Height of the logo space
  123. if only `QROptions::$logoSpaceHeight` is given, the logo space is assumed a square of that size
  124. ## logoSpaceStartX
  125. Optional horizontal start position of the logo space (top left corner)
  126. ## logoSpaceStartY
  127. Optional vertical start position of the logo space (top left corner)
  128. ## scale
  129. Pixel size of a QR code module
  130. ## imageTransparent
  131. Toggle transparency
  132. - `QRGdImage` and `QRImagick`: the given `QROptions::$transparencyColor` is set as transparent
  133. **See also:**
  134. - [github.com/chillerlan/php-qrcode/discussions/121](https://github.com/chillerlan/php-qrcode/discussions/121)
  135. ## transparencyColor
  136. Sets a transparency color for when `QROptions::$imageTransparent` is set to `true`.
  137. Defaults to `QROptions::$bgColor`.
  138. - `QRGdImage`: `[R, G, B]`, this color is set as transparent in `imagecolortransparent()`
  139. - `QRImagick`: `"color_str"`, this color is set in `Imagick::transparentPaintImage()`
  140. **See also:**
  141. - [php.net: `\imagecolortransparent()`](https://www.php.net/manual/function.imagecolortransparent)
  142. - [php.net: `\Imagick::transparentPaintImage()`](https://www.php.net/manual/imagick.transparentpaintimage)
  143. ## quality
  144. Compression quality
  145. The given value depends on the used output type:
  146. - `QRGdImageBMP`: `[0...1]`
  147. - `QRGdImageJPEG`: `[0...100]`
  148. - `QRGdImageWEBP`: `[0...9]`
  149. - `QRGdImagePNG`: `[0...100]`
  150. - `QRImagick`: `[0...100]`
  151. **See also:**
  152. - [php.net: `\imagebmp()`](https://www.php.net/manual/function.imagebmp)
  153. - [php.net: `\imagejpeg()`](https://www.php.net/manual/function.imagejpeg)
  154. - [php.net: `\imagepng()`](https://www.php.net/manual/function.imagepng)
  155. - [php.net: `\imagewebp()`](https://www.php.net/manual/function.imagewebp)
  156. - [php.net: `\Imagick::setImageCompressionQuality()`](https://www.php.net/manual/imagick.setimagecompressionquality)
  157. ## gdImageUseUpscale
  158. Toggles the usage of internal upscaling when `QROptions::$drawCircularModules` is set to `true` and
  159. `QROptions::$scale` is less than 20
  160. **See also:**
  161. - `\chillerlan\QRCode\Output\QRGdImage::createImage()`
  162. - [github.com/chillerlan/php-qrcode/issues/23](https://github.com/chillerlan/php-qrcode/issues/23)
  163. ## imagickFormat
  164. Imagick output format
  165. **See also:**
  166. - [php.net: `\Imagick::setImageFormat()`](https://www.php.net/manual/imagick.setimageformat)
  167. - [www.imagemagick.org/script/formats.php](https://www.imagemagick.org/script/formats.php)
  168. ## cssClass
  169. A common css class
  170. ## svgAddXmlHeader
  171. Whether to add an XML header line or not, e.g. to embed the SVG directly in HTML
  172. `<?xml version="1.0" encoding="UTF-8"?>`
  173. ## svgDefs
  174. Anything in the SVG `<defs>` tag
  175. **See also:**
  176. - [developer.mozilla.org/en-US/docs/Web/SVG/Element/defs](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/defs)
  177. ## svgPreserveAspectRatio
  178. Sets the value for the "preserveAspectRatio" on the `<svg>` element
  179. **See also:**
  180. - [developer.mozilla.org/en-US/docs/Web/SVG/Attribute/preserveAspectRatio](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/preserveAspectRatio)
  181. ## svgUseFillAttributes
  182. Whether to use the SVG `fill` attributes
  183. If set to `true` (default), the `fill` attribute will be set with the module value for the `<path>` element's `$M_TYPE`.
  184. When set to `false`, the module values map will be ignored and the QR Code may be styled via CSS.
  185. **See also:**
  186. - [developer.mozilla.org/en-US/docs/Web/SVG/Attribute/fill](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/fill)
  187. ## textLineStart
  188. An optional line prefix, e.g. empty space to align the QR Code in a console
  189. ## jsonFlags
  190. Sets the flags to use for the `json_encode()` call
  191. **See also:**
  192. - [www.php.net/manual/json.constants.php](https://www.php.net/manual/json.constants.php)
  193. ## fpdfMeasureUnit
  194. Measurement unit for `FPDF` output: `pt`, `mm`, `cm`, `in` (default: `pt`)
  195. **See also:**
  196. - `FPDF::__construct()`
  197. ## xmlStylesheet
  198. Sets an optional XSLT stylesheet in the XML output
  199. **See also:**
  200. - [developer.mozilla.org/en-US/docs/Web/XSLT](https://developer.mozilla.org/en-US/docs/Web/XSLT)
  201. ## readerUseImagickIfAvailable
  202. Use Imagick (if available) when reading QR Codes
  203. ## readerGrayscale
  204. Grayscale the image before reading
  205. ## readerInvertColors
  206. Invert the colors of the image
  207. ## readerIncreaseContrast
  208. Increase the contrast before reading
  209. note that applying contrast works different in GD and Imagick, so mileage may vary