Open GoogleCodeExporter opened 9 years ago
After many other tests, the bug description is incorrect : the pdf is
corrupted, whatever the Os.
But it opens correctly in every pdf reader, exception adobe pdf reader. How sad
...
Original comment by olivier....@gmail.com
on 28 May 2014 at 12:15
The results is that there is no bug in jspdf, but the generated string can't be
used directly in phonegap.
It has to be converted to a binary array, then written in file and opened.
example :
...
var pdfContent = doc.output();
var buffer = new ArrayBuffer(pdfContent.length);
var array = new Uint8Array(buffer);
for (var i = 0; i < pdfContent.length; i++) {
array[i] = pdfContent.charCodeAt(i);
}
... phonegapFileEntry.write(buffer);
The difficulty was that all readers except Adobe reader were successful in
reading file.
Original comment by olivier....@gmail.com
on 28 May 2014 at 3:15
Original issue reported on code.google.com by
olivier....@gmail.com
on 28 May 2014 at 7:17Attachments: