So in my experience and research which went on for 3-4 days, I came to the understanding that form IMM5257b_1 does not generate bar code. Also this form, though optional for my case, created a hell lot of issues when i tried to upload it. Even though i uploaded the electronic version it still showed the error that " you have uploaded an invalid form". It also mentioned that we cannot scan and upload should the electronic submission fails. What worked for me is the following (following the steps to the T).
1. Downloaded the form from this link :
https://www.canada.ca/content/dam/ircc/migration/ircc/english/pdf/kits/forms/imm5257b_1.pdf?
2. Opened this downloaded form on Acrobat Adobe Reader DC on my Mac.
3. Filled everything absolutely correctly and with the correct format, and deleted any extra
blank rows (for my travel history i had added extra rows).
4. Hit
VALIDATE ONLY ONCE. Dont hit validate every time you make a change, if you hit validate more than once, scratch that form and start all over from step 1.
5. After validating (no bar code generated) I didn't save the file using command save, instead clicked on the exit button of that pdf tab (the little "x" on top of the pdf tab), it asked me if I wanted to save the file and I clicked save there.
I dont know which of these steps made the difference but after such a long search and being completely frustrated I dont really care to know what went wrong as long as I was able to upload the file successfuly. Should the IRCC reject it, I will update it here.