You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
we're using your plugin in an iOS app.
We observed that if pass the same input to the plugin several times, we get different result base64 strings. The generated PDF looks consistent, but we are wondering what the cause for this behaviour could be.
We want to generate some critical packaging labels, so we need to be sure that the plugin behaves somewhat consistently - any idea what is going on? I didn't find anything by digging through the code...
Input: pdf.fromData('<style type="text/css">.clara {color: blue; font-weight: lighter; font-family: Arial, Helvetica}</style><html><div class="clara">Hello from Stuttgart!</div><div>Hallo aus Deutschland ... </div></html>', { documentSize: 'A4', type: 'base64'}).then(function(res) { console.log(res) })
It's going to be difficult to achieve accuracy at byte level between the same PDF, because the PDF API (used by the browser behind the scenes) adds arbitrary metadata values (like dates, prefixes, etc) in the PDF script code that internally defines the final document. If you transform this base64 into a PDF script you will find that objects in the PDF script are not even (sometimes) defined in the same order, which explains the difference in Base64 results.
On the other hand the visual accuracy will be there because that's the purpose of PDF technology.
Example:
Block of text defined internally in different order with arbitrary prefixes:
Hi Cesar,
many thanks for the explanation!
We were already suspecting that some dynamic stuff was inserted in the PDF, but since I found no such code neither in the plugin nor in the native code, I was wondering where that happened.
Hi,
we're using your plugin in an iOS app.
We observed that if pass the same input to the plugin several times, we get different result base64 strings. The generated PDF looks consistent, but we are wondering what the cause for this behaviour could be.
We want to generate some critical packaging labels, so we need to be sure that the plugin behaves somewhat consistently - any idea what is going on? I didn't find anything by digging through the code...
Input:
pdf.fromData('<style type="text/css">.clara {color: blue; font-weight: lighter; font-family: Arial, Helvetica}</style><html><div class="clara">Hello from Stuttgart!</div><div>Hallo aus Deutschland ... </div></html>', { documentSize: 'A4', type: 'base64'}).then(function(res) { console.log(res) })
Result:
pdf-result-1.txt
pdf-result-2.txt
The text was updated successfully, but these errors were encountered: