Hi Toni,

On 10/31/2018 2:29 AM, Toni Schaake wrote:
I understand that the PDF, when viewed as raw data is already "garbage", but in my test the "garbage" does not look the same as the original saved PDF. (Hope you understand what I mean here).


The problem is that yajl_addCharStmf() assumes the data to be character.  That's what was meant by "char" in "addCharStmf" (vs. something like addBinaryStmf), because it assumes the data to be character data, which a PDF is not. Since JSON documents are always in UTF-8 characters, it asks the OS to translate the data in the PDF into UTF-8 format.  This will change the binary values of your PDF, resulting in incorrect bytes.

The base64 solution will solve this problem, and is probably the best way to proceed.

-SK


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.