@@ -100,12 +100,12 @@ - (void)htmlToPDF:(CDVInvokedUrlCommand*)command
100
100
NSString * type = [command argumentAtIndex: 2 withDefault: @" A4" ];
101
101
NSString * _landscape = [command argumentAtIndex: 3 withDefault: @" portrait" ];
102
102
NSString * option = [command argumentAtIndex: 4 withDefault: @" base64" ];
103
- NSString * bUrl = [command argumentAtIndex: 6 withDefault: NULL ];
103
+ NSString * bUrl = [command argumentAtIndex: 6 withDefault: NULL ];
104
104
105
105
106
106
BNPageSize pageSize;
107
107
BOOL landscape = NO ;
108
- NSURL *baseUrl = nil ;
108
+ NSURL *baseUrl = nil ;
109
109
110
110
if ([type isEqualToString: @" A3" ]) {
111
111
pageSize = BNPageSizeA3;
@@ -119,13 +119,13 @@ - (void)htmlToPDF:(CDVInvokedUrlCommand*)command
119
119
landscape = YES ;
120
120
}
121
121
122
- if (bUrl != NULL ) {
123
- if ([bUrl isEqualToString: @" BUNDLE" ]) {
124
- baseUrl = [[NSBundle mainBundle ] bundleURL ];
125
- } else {
126
- baseUrl = [[NSURL alloc ] initWithString: bUrl];
127
- }
128
- }
122
+ if (bUrl != NULL ) {
123
+ if ([bUrl isEqualToString: @" BUNDLE" ]) {
124
+ baseUrl = [[NSBundle mainBundle ] bundleURL ];
125
+ } else {
126
+ baseUrl = [[NSURL alloc ] initWithString: bUrl];
127
+ }
128
+ }
129
129
130
130
if (url != NULL )
131
131
self.htmlPdfKit = [BNHtmlPdfKit saveUrlAsPdf: [NSURL URLWithString: url]
@@ -135,12 +135,12 @@ - (void)htmlToPDF:(CDVInvokedUrlCommand*)command
135
135
failure: [self GetErrorHandler: command]];
136
136
137
137
if (data != NULL ){
138
- NSURL *base = [[ NSURL alloc ] initWithString: [[ self .webViewEngine.URL absoluteString ] stringByDeletingLastPathComponent ] ];
138
+ NSURL *base = [[ NSBundle mainBundle ] bundleURL ];
139
139
140
140
self.htmlPdfKit = [BNHtmlPdfKit saveHTMLAsPdf: data
141
141
pageSize: pageSize
142
142
isLandscape: landscape
143
- baseUrl: base
143
+ baseUrl: base
144
144
success: [self GetPDFHandler: command setOptions: option]
145
145
failure: [self GetErrorHandler: command]];
146
146
0 commit comments