Page 1 of 1

How to use "byte array" as data to write PDF417 barcode?

Posted: Mon Oct 03, 2016 2:55 pm
by oha
Hi guys,
please, is there any way how to use "byte array" as barcode data?
Both BarcodePDF417Write method overloads expect "string" as data.
I would like to encode raw byte data -> should be possible with PDF 417 (with use of BarcodePDF417EncodingMode.BarcodePDF417EncodingModeByte), correct?
Any idea how to do that without base64 encoding?

Thank you!
Ondrej

Re: How to use "byte array" as data to write PDF417 barcode?

Posted: Tue Oct 04, 2016 2:59 pm
by Loïc
Hi,

Just pass the byte array as string using the correct encoding:

Code: Select all

string myString = Encoding.GetEncoding(1252).GetBytes(data);
Kind regards,

Loïc

Re: How to use "byte array" as data to write PDF417 barcode?

Posted: Tue Oct 04, 2016 5:12 pm
by oha
Hi Loïc,
are you sure it will work?
I mean byte array can contain whatever byte sequence (imagine byte[] from ZIP stream)
I'm afraid that some specific encoding could destroy the data.
What do you think?

Best regards,
Ondrej

Re: How to use "byte array" as data to write PDF417 barcode?

Posted: Tue Oct 04, 2016 5:16 pm
by Loïc
Yes I'm sure.