Closed taimingkang closed 1 year ago
MaxiCode symbols are meant to be a single physical size. From the spec: "Each symbol, including the quiet zone, is of a fixed physical size, nominally 28.14mm wide x 26.91mm high." I believe the hardcoded values in plotSymbol()
are the pixel dimensions matching these physical dimensions, assuming the PDF-standard 72 DPI. The various renderers (e.g. Java2DRenderer
) have magnification factors available which might be helpful if you need to adjust the sizes up or down (but keep in mind the spec size restriction mentioned above or you might create a non-compliant symbol).
Thank you very much for your proactive and detailed response. Are you saying that maxiCode itself does not provide the functionality to modify its width or height or perform proportional scaling, and that these adjustments can only be made when generating the image?
That's correct. Per the spec it's supposed to be a fixed physical side, which is reflected in the code as a fixed pixel size (but with an option to scale during rendering).
May I ask how to change the width and height of this MaxiCode 2D barcode? Or to scale it proportionally? Below is the code I use to generate MaxiCode,
and I've noticed that the settings for these two 'setModuleWidth' and 'setBarHeight' properties don't seem to have any effect. When I print the actual width and height of the MaxiCode object through the console, I see that they are still fixed at ' 72, 74' . Upon inspecting the MaxiCode source code, it appears that these 'symbol_height = 72;' and 'symbol_width = 74;' ,This comes from the void plotSymbol() method in MaxiCode() properties are fixed. Is this the reason why my width and height settings are not taking effect?