I am currently printing receipt from my data when i print my receipt alignment data is not working properly
i think that i should apply start index and end index to string
because my product name length is different So i apply this code to check length of string
here is screenshot of Receipt
you can see in receipt alignment is wrong
Here is my code to give alignment and receipt
if ProductName.characters.count > 13 {let subStr = ProductName[ProductName.startIndex.advancedBy(0)... ProductName.characters.count(13)]
strtext.appendString(String (format: "%@ %@ %@\n", sQuantity,subStr,s))
textData.appendString(strtext as String)
}
my requirement is first quantity,name and price should be come My receipt alignment is not proper
anyone can help me solve this issue?