cesarvr / pdf-generator-example

HTML to PDF Mobile application.
13 stars 10 forks source link

PDF not generated in iOS #10

Open macsupport opened 5 years ago

macsupport commented 5 years ago

Set up and compiled the example as directed and when run (using Xcode) in iOS 11 or 12, it does not generate a PDF. Here is the output from Xcode:

With Share:

2019-03-31 12:33:01.793350-0700 Testing[10543:894298] opening menu 2019-03-31 12:33:01.801262-0700 Testing[10543:894298] ERROR: -> TypeError: msg.replace is not a function. (In 'msg.replace('\n', '')', 'msg.replace' is undefined)

With Raw HTML:

2019-03-31 12:34:48.599280-0700 Testing[10543:894298] payload->                           <!DOCTYPE html>
                          <html lang="en">
                              <head>
                                  <meta charset="utf-8">
                                  <title>Hello World</title>
                              </head>
                              <body>
                                  <h1>Hello World</h1>
                                  <p>
                                      <h1>Hello.....</h1>
                                      <p>Testing UTF-8: </p> <p> 測試- تجريب - δοκιμή </p> 

                                  </p>

                                  <br>
                                  <h2> Testing Image Drawing </h2>
                                  <br>
                                  <img src="http://media-cache-ak0.pinimg.com/736x/82/ce/11/82ce113c9d64ae9ebbad36103841480f.jpg">

                                  <br>

                                  <h2> Testing Image Drawing using SSL </h2>
                                  <br>
                                  <img src="https://cdn.dribbble.com/users/61571/screenshots/301560/photo-camera-minimal-icon.jpg">

                                  <h2> Testing 4k </h2>
                                  <br>
                                  <img src="https://i.ytimg.com/vi/xcJtL7QggTI/maxresdefault.jpg">

                                  <h2> Testing Memory Stability </h2>
                                  <br>
                                  <br>
                                  <img src="https://i.ytimg.com/vi/xcJtL7QggTI/maxresdefault.jpg">

                                  <br>
                                  <br>
                                  <img src="https://i.ytimg.com/vi/xcJtL7QggTI/maxresdefault.jpg">

                                  <br>
                                  <br>
                                  <img src="https://i.ytimg.com/vi/xcJtL7QggTI/maxresdefault.jpg">

                                  <br>
                                  <br>
                                  <img src="https://i.ytimg.com/vi/xcJtL7QggTI/maxresdefault.jpg">

                                  <br>
                                  <br>
                                  <img src="https://i.ytimg.com/vi/xcJtL7QggTI/maxresdefault.jpg">

                                  <br>
                                  <br>
                                  <img src="https://i.ytimg.com/vi/xcJtL7QggTI/maxresdefault.jpg">

                                  <br>
                                  <br>
                                  <img src="https://i.ytimg.com/vi/xcJtL7QggTI/maxresdefault.jpg">

                                  <br>
                                  <br>
                                  <img src="https://i.ytimg.com/vi/xcJtL7QggTI/maxresdefault.jpg">

                                  <br>
                                  <br>
                                  <img src="https://i.ytimg.com/vi/xcJtL7QggTI/maxresdefault.jpg">

                                  <br>
                                  <br>
                                  <img src="https://i.ytimg.com/vi/xcJtL7QggTI/maxresdefault.jpg">

                                  <br>
                                  <br>
                                  <img src="https://i.ytimg.com/vi/xcJtL7QggTI/maxresdefault.jpg">

                                  <br>
                                  <br>
                                  <img src="https://i.ytimg.com/vi/xcJtL7QggTI/maxresdefault.jpg">

                                 <br>
                                  <br>
                                  <img src="https://i.ytimg.com/vi/xcJtL7QggTI/maxresdefault.jpg">

                                  <br>
                                  <br>
                                  <img src="https://i.ytimg.com/vi/xcJtL7QggTI/maxresdefault.jpg">

                                  <br>
                                  <br>
                                  <img src="https://i.ytimg.com/vi/xcJtL7QggTI/maxresdefault.jpg">

                                  <br>
                                  <br>
                                  <img src="https://i.ytimg.com/vi/xcJtL7QggTI/maxresdefault.jpg">

                                  <br>
                                  <br>
                                  <img src="https://i.ytimg.com/vi/xcJtL7QggTI/maxresdefault.jpg">

                                  <br>
                                  <br>
                                  <img src="https://i.ytimg.com/vi/xcJtL7QggTI/maxresdefault.jpg">

                                 <br>
                                  <br>
                                  <img src="https://i.ytimg.com/vi/xcJtL7QggTI/maxresdefault.jpg">

                                  <br>
                                  <br>
                                  <img src="https://i.ytimg.com/vi/xcJtL7QggTI/maxresdefault.jpg">

                                  <br>
                                  <br>
                                  <img src="https://i.ytimg.com/vi/xcJtL7QggTI/maxresdefault.jpg">

                                  <br>
                                  <br>
                                  <img src="https://i.ytimg.com/vi/xcJtL7QggTI/maxresdefault.jpg">

                                  <br>
                                  <br>
                                  <img src="https://i.ytimg.com/vi/xcJtL7QggTI/maxresdefault.jpg">

                                  <br>
                                  <br>
                                  <img src="https://i.ytimg.com/vi/xcJtL7QggTI/maxresdefault.jpg">

                                 <br>
                                  <br>
                                  <img src="https://i.ytimg.com/vi/xcJtL7QggTI/maxresdefault.jpg">

                                  <br>
                                  <br>
                                  <img src="https://i.ytimg.com/vi/xcJtL7QggTI/maxresdefault.jpg">

                                  <br>
                                  <br>
                                  <img src="https://i.ytimg.com/vi/xcJtL7QggTI/maxresdefault.jpg">

                                  <br>
                                  <br>
                                  <img src="https://i.ytimg.com/vi/xcJtL7QggTI/maxresdefault.jpg">

                                  <br>
                                  <br>
                                  <img src="https://i.ytimg.com/vi/xcJtL7QggTI/maxresdefault.jpg">

                                  <br>
                                  <br>
                                  <img src="https://i.ytimg.com/vi/xcJtL7QggTI/maxresdefault.jpg">

                              </body>
                          </html>
2019-03-31 12:34:48.613509-0700 Testing[10543:894298] url--> file:/Users/drmikey/Library/Developer/CoreSimulator/Devices/9944B809-ECB4-4F0C-BFA3-8A5317DF2193/data/Containers/Bundle/Application/ED0EAE31-5CFF-44D5-9D1B-AE49E2EA8B1F/Testing.app
2019-03-31 12:34:48.997136-0700 Testing[10543:894298] opening menu

Running cordova plugins in the Terminal:

cordova-pdf-generator 2.0.8 "PDFGenerator" cordova-plugin-compat 1.2.0 "Compat" cordova-plugin-file 4.3.3 "File" cordova-plugin-spinner 1.1.0 "Spinner Plugin" cordova-plugin-statusbar 2.4.2 "StatusBar" cordova-plugin-whitelist 1.3.3 "Whitelist" ionic-plugin-keyboard 2.2.1 "Keyboard"

Trying it in my own App, gives me the same errors and fails.

cesarvr commented 5 years ago

Thats here is the configuration I'm using, make sure you have those up to date:

Command

cordova platforms

Installed platforms:
  android 6.4.0
  ios 4.5.5

Cordova version:

cordova -v
9.0.0

Also make sure you do:

cordova prepare && cordova build 
macsupport commented 5 years ago

Using the same platforms and Cordova and did cordova prepare && cordova build as well Also tried iOS 5.0. Still has the error in Xcode and not PDF. The debugger will open in Safari but I see no errors.

I'm using Xcode 10.1

Also, here is the Xcode error for the Base64 button:

2019-03-31 13:27:53.927688-0700 Testing[11988:1139226] sending base64 2019-03-31 13:27:53.933219-0700 Testing[11988:1139226] ERROR Internal navigation rejected - not set for url='data:application/pdf,' 2019-03-31 13:28:01.349371-0700 Testing[11988:1150278] [] nw_socket_handle_socket_event [C5:2] Socket SO_ERROR [60: Operation timed out] 2019-03-31 13:28:01.349879-0700 Testing[11988:1150278] TIC TCP Conn Failed [5:0x600003063300]: 1:60 Err(60) 2019-03-31 13:28:01.350730-0700 Testing[11988:1150278] Task .<0> HTTP load failed (error code: -1001 [1:60]) 2019-03-31 13:28:01.350849-0700 Testing[11988:1139309] NSURLConnection finished with error - code -1001 2019-03-31 13:28:15.761257-0700 Testing[11988:1139309] [] nw_socket_handle_socket_event [C6:2] Socket SO_ERROR [60: Operation timed out] 2019-03-31 13:28:15.761561-0700 Testing[11988:1139309] TIC TCP Conn Failed [6:0x600003078e40]: 1:60 Err(60) 2019-03-31 13:28:15.762839-0700 Testing[11988:1139309] Task <551C92E5-E199-41CC-A589-D350101A7931>.<0> HTTP load failed (error code: -1001 [1:60]) 2019-03-31 13:28:15.762947-0700 Testing[11988:1150856] NSURLConnection finished with error - code -1001 2019-03-31 13:28:23.927601-0700 Testing[11988:1139226] Could not signal service com.apple.WebKit.WebContent: 113: Could not find specified service