januslo / react-native-bluetooth-escpos-printer

React-Native plugin for the bluetooth ESC/POS & TSC printers.
MIT License
359 stars 416 forks source link

print receipt from dynamic data #147

Open 16isaac89 opened 3 years ago

16isaac89 commented 3 years ago

how do i print from dynamic data for example [{"category": "cooking", "cost": 5000, "expiredate": 2021-02-16T05:49:00.000Z, "expires": "no", "id": "602b65ee7db22c", "image": "content://com.uuza.imagepickerprovider/cacheDir/rn_image_picker_lib_temp_08b50552-a3a2-43ff-b6e6-9c458daa331e.jpg", "name": "hose", "price": 20000, "quantity": 1, "stock": 48, "unit": "Pc(s)", "warn": 8}, {"category": "cooking", "cost": 15000, "expiredate": 2021-08-19T09:32:00.000Z, "expires": "yes", "id": "602b918b953f7c", "image": "content://com.uuza.imagepickerprovider/cacheDir/rn_image_picker_lib_temp_4170cf84-e05f-4fe4-a473-597ad766a875.jpg", "name": "gas", "price": 16000, "quantity": 1, "stock": 18, "unit": "", "warn": 9}]

Frankiz123 commented 2 years ago

hi @16isaac89 you can use map function to print the dynamic data