read file to bytearray adobe extendscript - extendscript

Is there a way to read a file in adobe extendscript to bytearray? I will upload
the bytes to a rest server.
Currently, i'm using below and it is giving me binary string.
var s = file.read();

Not really. The JavaScript interpreter ExtendScript is based on pre-dates the typed array datatypes. You'll have to work with the binary string.

Related

Convert BASE64 String to PDF file in the IFS on AS400

We receive a BASE64 encoded representation of a courier label PDF in an xml file, which we store in the IFS of our AS400.
We would like to decode this BASE64 string and save it as a .PDF in the IFS so we can then either email it as an attachment or send it to a printer.
I have looked at the capability of the CPYSPLF command using the *PDF WSCST parameter, but this only seems relevant where we would have a Spooled File representation of the label we want to produce.
Does anyone know if this is possible via native iSeries commands/RPG?
One way is to
IFS_READ_UTF8 to load the XML file
XMLPARSE to make it a XML object
XML_TABLE to extract BASE64 data
BASE64_DECODE to decode B64 data to PDF binary stream
IFS_WRITE_BINARY to write that stream as a .pdf file
You could make it a pure sql prodecure, or a SQLRPGLE program.
You also could extract BASE64 date using RPGLE XML-INTO. The use Scott Klement's BASE64 SRVPGM to decode it, then write it to the IFS

Convert Binary content of PDF file To JSON format using node.js

we want Json format from binary content of pdf file using node.js.
Actually we are getting binary content of pdf from 3 party api response , using this response we will save in our database ,so give me working code for convert binary pdf format to json format
in simple words
Please let us know , "any working code so i have just pass binary data got json data" .
The JSON format natively doesn't support binary data.
Use Base64 or base85
I think the best you can do space-wise is base85 which represents four bytes as five characters. However, this is only a 7% improvement over base64, it's more expensive to compute, and implementations are less common than for base64 so it's probably not a win.

ZPL II decode Z64 (base64 and LZ77) to human readable text in Python

I am trying to put together an app in python that will split a .prn file generated from Zebra Designer software containing thousands of labels in one file into single label files. I need to extract a highlighted below field and decode it to human readable form to use as names for the single label files. I have tried to decode base64 and decompress LZ77 as per instructions here on page 1435 that states:
Z64 encoding do the following:
• Compress the data using the LZ77 algorithm.
• Encode the compressed data using the MIME Base64 algorithm.
• Calculate a CRC across the encoded data.
• Add a unique header to differentiate the new format from the existing ASCII hexadecimal encoding.
Below is part of the label I am trying to decode back to human readable form just the same way the printer does.
^XA
^MMT
^PW709
^LL0472
^LS0
^FO256,288^GFA,04992,04992,00052,:Z64:
eJztlL9uHDcQxoegExYp6MKlIr6GgayXKvwISZ9HSHnF4sTDFTbg4l7HgIAzDypUOl3K0LgipRi4ISCG45lZniMJNpIyCHYEaKXlfvzxmz8EWGKJJZZY4j8WF195b4vHBBrD8wbZHI9phDI2fSwAutEqNPoGd2EEKDBiYY0nTQSD8QWq7P68zgOsvsfNTQUwDXxVGMDhqziw5hwra1A4FtMPGIq/OxbieNze0vYOAzZNOzrcpc4RzWVljcFMuOzwwBz3+4EXHdKqEY1hzQTDpWjac9Z8q1lT/LsknFfHRhz/LrS9veVTbDNpaueoTOeO/PTmkNcuVuboQ/EAo92UJ3ZLX9gN4YnDP5SbRG9IQ8myqaxtqpw3Sptorgt0DeFhTaTaNS7QH78MJubJxIk45/qQHe1LZHByEmDN5U/1M8cH4ehUqk4jc8wxieaYZo0NhAdP1RENnctzLlYDbT7p6IhzZg7pAccGwj/QNIVvroRTdPJ7qU9yO/qPOF4VDDa0kRumiB/O2aTQYBl0FM5EeUOVnK2TZg5kjAbG0VaHWTjmfYKicYcnjm3EafS0zMlA9pjjmQNdg1llhZY54sdU4vwqnBWVif1gtMENxFGzhj7WRV3tXp/yZvecV53cm7dFf2iviXNFHLf/7q3dpNkPVpO4AKf6UN7KOaieN6znIPUxPBIqzWe7E40NzMlrM9cHqP2oZDohtwUvW9ZsuyZOnDoTsvixcRgUc7h3yN1l7fUxPE/bOPuJjdvNHsQP9XUbaQq3W+5rrtZnzp5+X3c/cWKNofmk+tA8TIMv7jeZH+LA0P24kT+K/WyjpXbTmISDND++0LzgzIGhczxrjifNwG2tMLIf95Hm1K8sboRDTofuZ6R+0zeh+xllFDAwx36k+2Bc2aZvaffKGuo31qyJo2/DyY9ozri3s7mJF8MZDa36EO9zDEys+QP6/Kxd+LnfdYXHaYQ+VrAWjcxpKJ0zz8LkYpwltCNnSv5kzWQCaTbzbA9sunNycXfpyxzKKFYuPnUAc/h6lHvnL8ps58AjjkdAud/AqDz+zVFImq9wRCOrBOPX7aTJ5sR57Mc14VBardzXJw1g0vz2SxzLGlm1uxNH7l7Xn7Mfc59D3JcXsvM3Cp7R40eAp/Ao8kPOv4p7fuI/fLrEEkssscQS/8/4BE9yVVQ=:BB36
^PQ1,0,1,Y^XZ
I tried to use python code like below just to decode this line "eJztlL9uHDcQxoegExYp(...)fLrEEkssscQS/8/4BE9yVVQ=" so i stripped the ZPL language coding which is :Z64: prefix and :BB36 CRC output.
Code comes from this thread.
import zlib
import base64
def decode_base64_and_inflate(b64string):
decoded_data = base64.b64decode(b64string)
return zlib.decompress(decoded_data, 0)
Output I get is as such:
b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00#\x00\x00\x04\x00\x00\x00\x00#\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0f\xff\xf8\x7f\xff\x80\x00>\x03\xe0\xfe\x00\xf3\xf8\x07\x80?\x8e\x00\x00\x03\xfe\x00\x0f\xf8\x00\xfe\x00\x00\x0f\xff\x8f\x80>\x00\x00\xf8\x00>\xff\xf8\x00\x00\x00\x0f\xff\xf8\x7f\xff\xc0\x00?\x03\xc1\xff\x80w\xfc\x07\x80\x7f\xde\x00\x00\x07\xfe\x00?\xfc\x01\xff\x80\x00\x1f\xff\x87\xc0<\x00\x00\xf8\x00\x1e\xff\xfc\x00\x00\x00\x0f\xff\xf8\xff\xff\xc0\x00?\x83\xe3\xff\xc0\xff\xfe\x0f\x80\xff\xfe\x00\x00\x1f\xff\x80\xff\xfe\x03\xff\xc0\x00\x1f\xff\x8f\xe0>\x00\x00\xf8\x00>\xff\xfc\x00\x00\x00\x07\xff\xf0\x7f\xff\xc0\x00\x1f\x03\xc3\xff\xc0\x7f\x7f\x07\x81\xff\xfe\x00\x00\x1f\xff\x00\x7f\xfc\x07\xff\xc0\x00\x1f\xff\x07\xe0>\x00\x00|\x00<\x7f\xfc\x00\x00\x00\x0f\xff\xf8\x7f\xff\xc0\x00\x0f\x83\xe3\xef\xe0\xfe?\x0f\x83\xff\xfe\x00\x00?\xbf\x80\xfe\xbe\x0f\xef\xe0\x00\x0f\xff\x83\xf0>\x00\x00\xfc\x00>\xff\xfc\x00\x00\x00\x00\x01\xf0\x00\x0f\xc0\x00\x0f\xc3\xc3\x03\xf0|\x1f\x07\x81\xf0~\x00\x00>\x0f\x81\xf8\x04\x0f\x83\xf0\x00\x00\x0f\x81\xf0<\x00\x00|\x00|\x00|\x00\x00\x00\x00\x03\xf8\x00\x1f\x80\x00\x0f\xc3\xe2\x03\xf0\xf8\x0f\x8f\x83\xf0>\x00\x00>\x0f\xc3\xf8\x00\x0f\x83\xf0\x00\x00\x0f\x81\xf8>\x00\x00~\x00\xfc\x00\xfc\x00\x00\x00\x00\x07\xe0\x00\x1f\x00\x00\x07\xc7\xc0\x01\xf0p\x0f\x07\x83\xe0>\x00\x00|\x07\xc1\xf0\x00\x1f\x01\xf0\x00\x00\x07\x00\xf8>\x00\x00\x7fU\xfc\x00|\x00\x00\x00\x00\x0f\xe0\x00>\x00\x00\x03\xe3\xe0\x00\xf0\xf8\x0f\x0f\x83\xe0>\x00\x00|\x07\xe3\xe0\x00\x1f\x01\xf0\x00\x00\x0f\x80\xfc>\x00\x00?\xff\xf8\x00|\x00\x00\x00\x00\x1f\xc0\x00|\x00\x00\x01\xf3\xc0\x01\xf0x\x1f\x07\x83\xc0\x1e\x00\x00|\x07\xc1\xf0\x00\x1f\x01\xf0\x00\x00\x0f\x80|<\x00\x00?\xff\xf8\x00|\x00\x00\x00\x00?\x80\x00\xfc\x03\xfe\x03\xfb\xe0\x01\xf8\xff\xfe\x0f\x83\xe0>\x0f\xf8\xf8\x03\xe3\xe0\x00?\x01\xf8\xff\x80\x0f\x80\xfe>\x0f\xf8?\xff\xf8\x00\xfc\x00\x00\x00\x00?\x00\x01\xf8\x03\xff\x01\xf3\xc0\x01\xf0\x7f\xfc\x07\x83\xc0\x1e\x0f\xfc|\x03\xc1\xf0\x00\x1f\x00\xf0\xff\xc0\x07\x00>>\x0f\xfc\x1f\xff\xf0\x00|\x00\x00\x00\x00~\x00\x03\xf8\x03\xfe\x00\xff\xe0\x00\xf8\xff\xf8\x0f\x83\xe0>\x0f\xf8\xf8\x03\xe3\xf0\x00>\x00\xf8\xff\x80\x0f\x80?>\x0f\xf8?\x00\xf0\x00|\x00\x00\x00\x00|\x00\x03\xf0\x03\xff\x00\x7f\xc0\x01\xf0\x7f\xc0\x07\x83\xc0\x1e\x0f\xfcx\x03\xc1\xf8\x00\x1f\x01\xf0\xff\xc0\x0f\x80\x1f<\x0f\xfc\x1f\x01\xf0\x00|\x00\x00\x00\x00\xfc\x00\x0f\xe0\x03\xba\x00\xfb\xe0\x01\xf8\xf8\x00\x0f\x83\xe0>\x0b\xb8\xf8\x03\xe1\xfe\x88>\x00\xf8\xbb\x80\x0f\x80\x1f\xbe\x0b\xb8\x0f\x81\xe0\x00\xfc\x00\x00\x00\x01\xf8\x00\x07\xc0\x00\x00\x01\xf7\xc0\x01\xf0p\x00\x07\x83\xe0\x1e\x00\x00|\x07\xc1\xff\xfc\x1e\x00\xf0\x00\x00\x07\x00\x07\xfe\x00\x00\x0f\x01\xe0\x00|\x00\x00\x00\x03\xf8\x00\x0f\x80\x00\x00\x03\xe3\xe0\x03\xf0\xf8\x00\x0f\x83\xe0>\x00\x00\xf8\x03\xe0\xff\xfc>\x00\xf8\x00\x00\x0f\x80\x0f\xfe\x00\x00\x0f\x83\xe0\x00|\x00\x00\x00\x01\xf0\x00\x1f\x80\x00\x00\x03\xc3\xc1\x01\xf0x\x00\x07\x81\xf0~\x00\x00|\x03\xc0\x7f\xfc\x1f\x01\xf0\x00\x00\x0f\x80\x07\xfc\x00\x00\x07\x83\xc0\x00|\x00\x00\x00\x03\xf0\x00\x1f\x80\x00\x00\x0f\xe3\xe3\x8f\xe0\xfc\x0e\x0f\x83\xf8\xfe\x00\x00\xf8\x03\xe0?\xfc>\x00\xf8\x00\x00\x0f\x80\x0f\xbe\x00\x00\x0f\xc3\xe0\x00\xfc\x00\x00\x00\x03\xe0\x00\x1f\x00\x00\x00\x07\xc3\xc3\xff\xc0\x7f~\x07\x81\xff\xfe\x00\x00|\x03\xc0\x00<\x1e\x00\xf0\x00\x00\x07\x00\x1f>\x00\x00\x07\xc3\xc0\x00|\x00\x00\x00\x07\xe0\x00?\x00\x00\x00\x0f\x83\xe3\xff\xe0\x7f\xfe\x0f\x80\xff\xfe\x00\x00\xf8\x03\xe0\x00<>\x00\xf8\x00\x00\x0f\x80?>\x00\x00\x07\xe3\xc0\x00|\x00\x00\x00\x07\xc0\x00?\x00\x00\x00\x1f\x03\xc1\xff\x80?\xfc\x07\x80\xff\xde\x00\x00|\x07\xc0\x00<\x1f\x01\xf0\x00\x00\x0f\x80><\x00\x00\x03\xc7\x80\x00|\x00\x00\x00\x0f\xe0\x00?\x80\x00\x00?\x83\xe1\xff\x80?\xf8\x0f\x80\xff\xbe\x00\x00\xfc\x07\xc0\x00<?\x01\xf8\x00\x00\x0f\x80~>\x00\x00\x03\xef\x80\x00\xfc\x00\x00\x00\x07\xe0\x00?\x00\x00\x00\x04\x07\xc0|\x00\x07\xc0\x07\x80\x1c\x1e\x00\x00|\x07\xc0\x00<\x1f\x01\xf0\x00\x00\x07\x00|>\x00\x00\x03\xe7\x00\x00|\x00\x00\x00\x07\xe0\x00?\x80\x80\x00\x00\x03\xe0\x00\x00\x00\x00\x0f\x80\x00>\x00\x00~\x07\xc0\x00<\x1f\x83\xf0\x00\x00\x0f\x80\xf8>\x00\x00\x03\xef\x80\x00|\x00\x00\x00\x07\xf00?\x81\x80\x00\x00\x03\xc0\x00\x00\x00\x00\x07\x80\x00\x1e\x00\x00|\x07\x80\x00<\x1f\x81\xf0\x00\x00\x0f\x81\xf8<\x00\x00\x01\xff\x00\x00|\x00\x00\x00\x07\xfb\xf8?\xef\x80\x00\x00\x03\xe0\x00\x00\x00\x00\x0f\x80\x00>\x00\x00>\x0f\x80\xff\xfc\x0f\x83\xe0\x00\x00\x0f\x83\xf8>\x00\x00\x01\xff\x80\x00\xfc\x00\x00\x00\x03\xff\xf0\x1f\xff\xc0\x00\x00\x03\xc0\x00\x00\x00\x00\x07\x80\x00\x1e\x00\x00?\xff\x00\xff\xfc\x07\xff\xc0\x00\x00\x07\x01\xf0>\x00\x00\x01\xff\x00\x00|\x00\x00\x00\x03\xff\xf8\x1f\xff\x80\x00\x00\x03\xe0\x00\x00\x00\x00\x0f\x80\x00>\x00\x00?\xff\x00\xff\xfc\x0f\xff\xe0\x00\x00\x0f\x83\xe0>\x00\x00\x00\xfe\x00\x00|\x00\x00\x00\x01\xff\xf0\x0f\xff\x80\x00\x00\x03\xc0\x00\x00\x00\x00\x07\x80\x00\x1e\x00\x00\x1f\xfe\x00\xff\xfc\x07\xff\x80\x00\x00\x0f\x87\xc0<\x00\x00\x00\xfe\x00\x00|\x00\x00\x00\x00\xff\xe0\x0f\xfe\x00\x00\x00\x03\xe0\x00\x00\x00\x00\x0f\x80\x00>\x00\x00\x0f\xfe\x00\xff\xfc\x03\xff\x80\x00\x00\x0f\x8f\xe0>\x00\x00\x00\xfe\x00\x00\xfc\x00\x00\x00\x00\x7f\x00\x01\xf0\x00\x00\x00\x07\xc0\x00\x00\x00\x00\x07\x80\x00\x1e\x00\x00\x01\xf0\x00D#\x00|\x00\x00\x00\x05\x01\x00\x14\x00\x00\x00T\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\xe0\x00\x00\x00\x00\x0f\x80\x00>\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\xc0\x00\x00\x00\x00\x07\x80\x00\x1c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
When run the original label code through Labelary viewer it shows as text with some special charactes. How do I calculate this compressed text back to human readable form?
You can try to use this method to create the PNG:
https://codeutility.org/javascript-convert-zpl-base64-in-image-png-stack-overflow/

Nodejs fs.readfile vs new buffer binary

I have a situation where I receive a base64 encoded image, decode it, then want to use it in some analysis activity.
I can use Buffer to go from base64 to binary but i seem to be unable to use that output as expected (as an image).
The solution now is to convert to binary, write it to a file, then read that file again. The FS output can be used as an image but this approach seems a bit inefficient and additional steps as i would expect the buffer output to also be a usable image as it has the same data?
my question, is how does the fs.readfile output differ from the buffer output? And is there a way i can use the buffer output as i would the fs output?
Buffer from a base64 string:
var bin = new Buffer(base64String, 'base64').toString('binary');
Read a file
var bin = fs.readFileSync('image.jpg');
Many thanks

Zip in j2me using jazzlib

I am using jazzlib package in j2me application to compress the xml file in zip format using ZipOutputStream and the send the compress stream to the server as a string . I am able to do unzip the in mobile using ZipInputStream. But in server i am not able to unzip , i got
EOF exception. when i copy the compressed stream from console and put into browser, the empty space put special character like [] in compressed stream. I didnt understand what happened. Plz help
You send the compressed stream as a String? That's your problem(s) right there:
compressed data is binary data (i.e. byte[]).
String is designed to handle textual (Unicode) data and not arbitrary binary data
converting arbitrary binary data to String is bound to lead to problems
So if you want to handle (send/receive/...) binary data, make sure you never use a String/Reader/Writer to handle the data anywhere in the process. Stay with byte[]/InputStream/OutputStream.

Resources