cesarvr / pdf-generator

Cordova plugin to generate pdf in the client-side
MIT License
107 stars 61 forks source link

Fixes for issue #59 and issue #60 #61

Closed wnbittle closed 6 years ago

wnbittle commented 6 years ago

Code changes for issue #59 and issue #60.

59: Added a baseUrl option that you can supply "BUNDLE" or a url. This will be converted to [[NSBundle mainBundle] bundleURL] or the given url respectively. This is then used to set the baseUrl for the wkwebview in the BNHtmlPdfKit class.

60: Commented out the code that resets the document size to A4.

wnbittle commented 6 years ago

A follow up question to this pull request: The plugin in npm seems to be using the old UIWebView. Is this right or am I pulling an old version or something?

cesarvr commented 6 years ago

Yes, I'm thinking to release the plugin to make use the new UIWebView version , but I'm a little concern that it may be stop working with older versions of Android.

wnbittle commented 6 years ago

According to this WKWebView is supported on iOS 8+ which according to this has decent device support. That said, my understanding is that WKWebView, when it first came out, had some issues (and still has some?).

As a reference, the cordova plugin to use WKWebView instead of UIWebView for the main application has some information on this: cordova-plugin-wkwebview-engine I think they are recommending iOS 9+ which has similar if not the same device compatibility. I am using this plugin in my app and limiting my deployment targets to iOS 9+.

That said, for the moment I'm not using the latest WKWebView version of this code set, I'm using the current npm version (UIWebView) modified for my purposes (I always set the baseUrl to the bundleURL).

I've seen other cordova plugins just release alternate plugins that include/exclude certain functionality based on supported platforms.

wnbittle commented 6 years ago

That said, for the moment I'm not using the latest WKWebView version of this code set, I'm using the current npm version (UIWebView) modified for my purposes (I always set the baseUrl to the bundleURL).

Sorry for the confusion, i take this back. I am using the WKWebView version of the code as this fixed page break issues described in PR #56 that I also experienced.