Open CooperLaredo opened 5 years ago
Assuming that file is in the FileSystem then, in iOS you'll need to use the cordova-plugin-file, example:
if (cordova.platformId === 'ios') {
// this function is from the cordova-plugin-file...
window.resolveLocalFileSystemURL(cordova.file.applicationDirectory,
function(url) {
//url represents the asset folder www/
// generate your template
let tmpl = payload({ css_file: url + '/' +cssFile, content: content })
// generate PDF
pdf.fromData(payload, opts).then(/.../)
},
function(err) {
console.log('error', err, ' args ->', arguments)
}
);
I followed along with the example in the documentation and I can't seem to get the styles to show up in the Print Preview for iOS.
-Since it's iOS, I set cssFile to www/styles.bundle.css -Content is just the innerHTML of the page I'm trying to make a pdf of.
I'm not sure if cssFile is set to the correct path because the pdf looks completely unformatted except for a couple colors from inline styles. Any help would be appreciated!