>Is there any API function that generate the characters to binary data?
>
Yes, it's called the Windows GDI - you send streams of characters to it and it formats them and adapts the output to the targeted print device. IOW, just send the output to the printer via the normal Windows print mechanisms.