【发布时间】:2015-03-18 13:22:22
【问题描述】:
我有一个解码问题。
我有一个离线桌面应用程序,我必须在其中生成一个 pdf 文件并在他打开时保存。
要生成 PDF 文件,我使用 BytescoutPDF librarycreatepdf.js。
这将返回一个我必须保存的文档变量。 我试过了:
//this calls the createPDF to BytescoutPDF library
//and returns the variable into 'doc'
var doc = generaStaticPartBolla_2();
//take the stream
var bolla = Ti.Filesystem.getFileStream(billPath);
//open in write mode
bolla.open(Ti.Filesystem.MODE_WRITE);
//write the doc file decodified in Base 64
bolla.write(doc.getBase64Text());
//close the stream
bolla.close();
现在,生成的文件已损坏。 我无法打开这个。我怎样才能做到这一点?该文件必须转换为 Base 64 或其他?
【问题讨论】:
标签: javascript pdf utf-8 save tidesdk