Windows10下使用qrencode生成带换行二维码的问题
在Windows 10中解决qrencode二维码内容换行问题
你在Windows 10下用qrencode生成二维码图片成功,但用\n无法实现内容换行——原因是Windows命令提示符(CMD)不会把\n解析为换行符,以下是两种可行的解决方法:
方法一:直接在命令行输入多行内容
在CMD中输入命令时,用双引号包裹所有内容,写完一行后直接按回车继续输入下一行,CMD会自动保留这些换行:
d:\qrencode -o qrcode.png "INDO GERMAN ALKALOIDS Unique ID: ABC-123456789 API-Name: ABCDEFGH Brand: Indo-101 Address: Inga House, Mahakali Road, Andheri-East, Mumbai-400093, Tel-022-28202932/33, Mobile: 9833942075, Batch No.: XYZ888999000, Batch Size: 1020, Mfgd.Date: 29-12-2022, Expiry Date: 31-12-2023, Container Code: RRR-101020, Mfgr Lic.No.: ------------, Storage Instruction: Store in cool area 20deg"
方法二:通过文本文件传递内容
- 新建一个文本文件(比如
content.txt),在里面按需求写好带换行的内容:
INDO GERMAN ALKALOIDS Unique ID: ABC-123456789 API-Name: ABCDEFGH Brand: Indo-101 Address: Inga House, Mahakali Road, Andheri-East, Mumbai-400093, Tel-022-28202932/33, Mobile: 9833942075, Batch No.: XYZ888999000, Batch Size: 1020, Mfgd.Date: 29-12-2022, Expiry Date: 31-12-2023, Container Code: RRR-101020, Mfgr Lic.No.: ------------, Storage Instruction: Store in cool area 20deg
- 在CMD中执行命令,让qrencode读取这个文件的内容:
d:\qrencode -o qrcode.png < content.txt
内容的提问来源于stack exchange,提问作者Fred
相关产品推荐
相关产品推荐

