Is it possible to read a standard etherpad as a text document over the api? - etherpad

I have a public etherpad containing an yaml-file. Using php I would like read this yaml and convert it to a json-string.
There are some great libraries for converting yaml to json. for example:
https://github.com/mustangostang/spyc/
What i'm looking for is an url that will return the contents of a pad as pure text.

You want the text export then. You can easily get the contents of a pad exported as raw text, using the following url:
//<yourdomain>.com/p/<yourpad>/export/txt

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

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/

How can I call convert a piece of SVG to MVG via RMagick?

I want to convert a piece of SVG to MVG. Could I do something similar to this convert msvg:pram.svg pram.mvg using RMagick methods? I don't want to save the output in a file, but I want to have it in a variable in Ruby.
In general, converting an image in one format to another format is as simple as making a copy of the image using a different suffix. https://rmagick.github.io/comtasks.html#convert
Use the to_blob method to get an image as a Ruby string:
https://rmagick.github.io/comtasks.html#blob

How to prevent excel from changing csv file encoding after save? [duplicate]

This question already has answers here:
Excel to CSV with UTF8 encoding [closed]
(36 answers)
Closed 7 years ago.
I'm trying to implement a simple data import to my MVC application from .csv file.
To remove the need for user to save .csv file template in his computer and from going through the trouble of getting it in the first place, I created a button on my form that generates the template.
I generate a string from my model object in a writer class:
this.Writer.GetCswTemplate() returns string from viewModel (i.e. column1;colum2\r\n)
As per How to GetBytes() in C# with UTF8 encoding with BOM?
I force excel to open .csv file with UTF-8 encoding:
var templateResult = Encoding.UTF8.GetBytes(this.Writer.GetCswTemplate());
var preamble = Encoding.UTF8.GetPreamble();
var templateBytes = preamble.Concat(templateResult).ToArray();
to send the generated template to the user I use MVC File() helper:
return this.File(templateBytes, "application/csv", "filename.csv");
It works great, it generates the template, returns it to the user, opens it with Excel and shows all the special characters in it. If I open the generated file in Notepad++ I can see that it's encoding is UTF-8.
The problem occurs when a user fills the generated template and saves it inside Excel. For some reason Excel decides to change file encoding to ANSI.
Is there any way for me to prevent that? Did I miss something (Add some kind of header or something)?
Interestingly if I generate template with UTF-8 (without BOM), modify said file in excel and save it, Excel does not change its encoding to ANSI. The problem then is that Excel does not recognize the special characters inside template.
UTF-8 is an encoding set that can contain any Unicode character. Unfortunately, not all applications can encode files in UTF-8 by default, and Microsoft Excel is one of them.
Instead of Unicode, Excel encodes CSV files using ANSI
One would either need to ask the user to open the file in notepad and save in the correct format (to much work!) or work out some detection/conversion logic.

how to convert arabic content to unicode format in nodejs?

I have arabic content that I need to convert to unicode in node.js. For example دبي, this text should convert to \u062f\u0628\u064a.
What must I do to achieve this within node.js? Are there any packages which might help?
Try this module - https://github.com/mathiasbynens/jsesc
jsesc('دبي')
'\\u062F\\u0628\\u064A'
This might help you too https://gist.github.com/mathiasbynens/1243213

Resources