endroid / qr-code

QR Code Generator
https://endroid.nl
MIT License
4.41k stars 725 forks source link

PArameter documentation #426

Closed B0rner closed 10 months ago

B0rner commented 10 months ago

Hey,

in the readme.md there is an example, how to use the class, like this:

$result = Builder::create() ->writer(new PngWriter()) ->writerOptions([]) ->data('Custom QR code contents') ->encoding(new Encoding('UTF-8')) ->errorCorrectionLevel(ErrorCorrectionLevel::High) ->size(300) ->margin(10) ->roundBlockSizeMode(RoundBlockSizeMode::Margin) ->logoPath(DIR.'/assets/symfony.png') ->logoResizeToWidth(50) ->logoPunchoutBackground(true) ->labelText('This is the label') ->labelFont(new NotoSans(20)) ->labelAlignment(LabelAlignment::Center) ->validateResult(false) ->build();

But I can't found any documentation about the valid parameters.

For example: errorCorrectionLevel(ErrorCorrectionLevel::High) What are the possible values? Or what does 300stands for in ->size(300)? px? pt? em? I use size 300 with base64 output, but the image isshow very large. Maybe scaled by the browser maybe generated in >300px

Are there any alternative parameters for ->roundBlockSizeMode(RoundBlockSizeMode::Margin)??

Is there a detailed documentation for all the parameters, also for the writer, etc.?

endroid commented 10 months ago

Hi @B0rner you can find the valid ErrorCorrectionLevel values in the enum and your IDE will suggest the available values when developing, the size is generally in pixels and the RoundBlockSizeMode values can be found in the enum and are documented at https://github.com/endroid/qr-code#round-block-size-mode. Good luck!

B0rner commented 10 months ago

Thank you for answering that question so fast.