@@ -260,13 +260,9 @@ public function __construct($exePath)
260
260
* @param array $dats An optional array in which to return data messages.
261
261
* @return bool `true` if a PDF file was generated successfully.
262
262
*/
263
- public function convert_file ($ inputPath , &$ msgs = array (), &$ dats = array ())
263
+ public function convertFile ($ inputPath , &$ msgs = array (), &$ dats = array ())
264
264
{
265
- $ pathAndArgs = $ this ->getCommandLine ();
266
- $ pathAndArgs .= '--structured-log=normal ' ;
267
- $ pathAndArgs .= '" ' . $ inputPath . '" ' ;
268
-
269
- return $ this ->fileToFile ($ pathAndArgs , $ msgs , $ dats );
265
+ return $ this ->convert_file ($ inputPath , $ msgs , $ dats );
270
266
}
271
267
272
268
/**
@@ -279,17 +275,13 @@ public function convert_file($inputPath, &$msgs = array(), &$dats = array())
279
275
* @param array $dats An optional array in which to return data messages.
280
276
* @return bool `true` if a PDF file was generated successfully.
281
277
*/
282
- public function convert_file_to_file (
278
+ public function convertFileToFile (
283
279
$ inputPath ,
284
280
$ pdfPath ,
285
281
&$ msgs = array (),
286
282
&$ dats = array ()
287
283
) {
288
- $ pathAndArgs = $ this ->getCommandLine ();
289
- $ pathAndArgs .= '--structured-log=normal ' ;
290
- $ pathAndArgs .= '" ' . $ inputPath . '" -o " ' . $ pdfPath . '" ' ;
291
-
292
- return $ this ->fileToFile ($ pathAndArgs , $ msgs , $ dats );
284
+ return $ this ->convert_file_to_file ($ inputPath , $ pdfPath , $ msgs , $ dats );
293
285
}
294
286
295
287
/**
@@ -302,22 +294,13 @@ public function convert_file_to_file(
302
294
* @param array $dats An optional array in which to return data messages.
303
295
* @return bool `true` if a PDF file was generated successfully.
304
296
*/
305
- public function convert_multiple_files (
297
+ public function convertMultipleFiles (
306
298
$ inputPaths ,
307
299
$ pdfPath ,
308
300
&$ msgs = array (),
309
301
&$ dats = array ()
310
302
) {
311
- $ pathAndArgs = $ this ->getCommandLine ();
312
- $ pathAndArgs .= '--structured-log=normal ' ;
313
-
314
- foreach ($ inputPaths as $ inputPath ) {
315
- $ pathAndArgs .= '" ' . $ inputPath . '" ' ;
316
- }
317
-
318
- $ pathAndArgs .= '-o " ' . $ pdfPath . '" ' ;
319
-
320
- return $ this ->fileToFile ($ pathAndArgs , $ msgs , $ dats );
303
+ return $ this ->convert_multiple_files ($ inputPaths , $ pdfPath , $ msgs , $ dats );
321
304
}
322
305
323
306
/**
@@ -330,21 +313,12 @@ public function convert_multiple_files(
330
313
* @param array $dats An optional array in which to return data messages.
331
314
* @return bool `true` if a PDF file was generated successfully.
332
315
*/
333
- public function convert_multiple_files_to_passthru (
316
+ public function convertMultipleFilesToPassthru (
334
317
$ inputPaths ,
335
318
&$ msgs = array (),
336
319
&$ dats = array ()
337
320
) {
338
- $ pathAndArgs = $ this ->getCommandLine ();
339
- $ pathAndArgs .= '--structured-log=buffered ' ;
340
-
341
- foreach ($ inputPaths as $ inputPath ) {
342
- $ pathAndArgs .= '" ' . $ inputPath . '" ' ;
343
- }
344
-
345
- $ pathAndArgs .= '-o - ' ;
346
-
347
- return $ this ->fileToPassthru ($ pathAndArgs , $ msgs , $ dats );
321
+ return $ this ->convert_multiple_files_to_passthru ($ inputPaths , $ msgs , $ dats );
348
322
}
349
323
350
324
/**
@@ -357,15 +331,12 @@ public function convert_multiple_files_to_passthru(
357
331
* @param array $dats An optional array in which to return data messages.
358
332
* @return bool `true` if a PDF file was generated successfully.
359
333
*/
360
- public function convert_file_to_passthru (
334
+ public function convertFileToPassthru (
361
335
$ inputPath ,
362
336
&$ msgs = array (),
363
337
&$ dats = array ()
364
338
) {
365
- $ pathAndArgs = $ this ->getCommandLine ();
366
- $ pathAndArgs .= '--structured-log=buffered " ' . $ inputPath . '" -o - ' ;
367
-
368
- return $ this ->fileToPassthru ($ pathAndArgs , $ msgs , $ dats );
339
+ return $ this ->convert_file_to_passthru ($ inputPath , $ msgs , $ dats );
369
340
}
370
341
371
342
/**
@@ -378,15 +349,12 @@ public function convert_file_to_passthru(
378
349
* @param array $dats An optional array in which to return data messages.
379
350
* @return bool `true` if a PDF file was generated successfully.
380
351
*/
381
- public function convert_string_to_passthru (
352
+ public function convertStringToPassthru (
382
353
$ inputString ,
383
354
&$ msgs = array (),
384
355
&$ dats = array ()
385
356
) {
386
- $ pathAndArgs = $ this ->getCommandLine ();
387
- $ pathAndArgs .= '--structured-log=buffered - ' ;
388
-
389
- return $ this ->stringToPassthru ($ pathAndArgs , $ inputString , $ msgs , $ dats );
357
+ return $ this ->convert_string_to_passthru ($ inputString , $ msgs , $ dats );
390
358
}
391
359
392
360
/**
@@ -399,17 +367,13 @@ public function convert_string_to_passthru(
399
367
* @param array $dats An optional array in which to return data messages.
400
368
* @return bool `true` if a PDF file was generated successfully.
401
369
*/
402
- public function convert_string_to_file (
370
+ public function convertStringToFile (
403
371
$ inputString ,
404
372
$ pdfPath ,
405
373
&$ msgs = array (),
406
374
&$ dats = array ()
407
375
) {
408
- $ pathAndArgs = $ this ->getCommandLine ();
409
- $ pathAndArgs .= '--structured-log=normal ' ;
410
- $ pathAndArgs .= ' - -o " ' . $ pdfPath . '" ' ;
411
-
412
- return $ this ->stringToFile ($ pathAndArgs , $ inputString , $ msgs , $ dats );
376
+ return $ this ->convert_string_to_file ($ inputString , $ pdfPath , $ msgs , $ dats );
413
377
}
414
378
415
379
/* RASTERIZATION METHODS **************************************************/
@@ -2203,4 +2167,190 @@ private function cmdlineArgEscape2($argStr)
2203
2167
2204
2168
return $ argStr ;
2205
2169
}
2170
+
2171
+ /* PDF CONVERSION METHODS (DEPRECATED) ************************************/
2172
+
2173
+ /**
2174
+ * [DEPRECATED]
2175
+ * Convert an XML or HTML file to a PDF file. The name of the output PDF
2176
+ * file will be the same as the name of the input file but with an extension
2177
+ * of ".pdf".
2178
+ *
2179
+ * @deprecated 1.2.0 Prefer `convertFile` instead.
2180
+ *
2181
+ * @param string $inputPath The filename of the input XML or HTML document.
2182
+ * @param array $msgs An optional array in which to return error and warning
2183
+ * messages.
2184
+ * @param array $dats An optional array in which to return data messages.
2185
+ * @return bool `true` if a PDF file was generated successfully.
2186
+ */
2187
+ public function convert_file ($ inputPath , &$ msgs = array (), &$ dats = array ())
2188
+ {
2189
+ $ pathAndArgs = $ this ->getCommandLine ();
2190
+ $ pathAndArgs .= '--structured-log=normal ' ;
2191
+ $ pathAndArgs .= '" ' . $ inputPath . '" ' ;
2192
+
2193
+ return $ this ->fileToFile ($ pathAndArgs , $ msgs , $ dats );
2194
+ }
2195
+
2196
+ /**
2197
+ * [DEPRECATED]
2198
+ * Convert an XML or HTML file to a PDF file.
2199
+ *
2200
+ * @deprecated 1.2.0 Prefer `convertFileToFile` instead.
2201
+ *
2202
+ * @param string $inputPath The filename of the input XML or HTML document.
2203
+ * @param string $pdfPath The filename of the output PDF file.
2204
+ * @param array $msgs An optional array in which to return error and warning
2205
+ * messages.
2206
+ * @param array $dats An optional array in which to return data messages.
2207
+ * @return bool `true` if a PDF file was generated successfully.
2208
+ */
2209
+ public function convert_file_to_file (
2210
+ $ inputPath ,
2211
+ $ pdfPath ,
2212
+ &$ msgs = array (),
2213
+ &$ dats = array ()
2214
+ ) {
2215
+ $ pathAndArgs = $ this ->getCommandLine ();
2216
+ $ pathAndArgs .= '--structured-log=normal ' ;
2217
+ $ pathAndArgs .= '" ' . $ inputPath . '" -o " ' . $ pdfPath . '" ' ;
2218
+
2219
+ return $ this ->fileToFile ($ pathAndArgs , $ msgs , $ dats );
2220
+ }
2221
+
2222
+ /**
2223
+ * [DEPRECATED]
2224
+ * Convert multiple XML or HTML files to a PDF file.
2225
+ *
2226
+ * @deprecated 1.2.0 Prefer `convertMultipleFiles` instead.
2227
+ *
2228
+ * @param array $inputPaths An array of the input XML or HTML documents.
2229
+ * @param string $pdfPath The filename of the output PDF file.
2230
+ * @param array $msgs An optional array in which to return error and warning
2231
+ * messages.
2232
+ * @param array $dats An optional array in which to return data messages.
2233
+ * @return bool `true` if a PDF file was generated successfully.
2234
+ */
2235
+ public function convert_multiple_files (
2236
+ $ inputPaths ,
2237
+ $ pdfPath ,
2238
+ &$ msgs = array (),
2239
+ &$ dats = array ()
2240
+ ) {
2241
+ $ pathAndArgs = $ this ->getCommandLine ();
2242
+ $ pathAndArgs .= '--structured-log=normal ' ;
2243
+
2244
+ foreach ($ inputPaths as $ inputPath ) {
2245
+ $ pathAndArgs .= '" ' . $ inputPath . '" ' ;
2246
+ }
2247
+
2248
+ $ pathAndArgs .= '-o " ' . $ pdfPath . '" ' ;
2249
+
2250
+ return $ this ->fileToFile ($ pathAndArgs , $ msgs , $ dats );
2251
+ }
2252
+
2253
+ /**
2254
+ * [DEPRECATED]
2255
+ * Convert multiple XML or HTML files to a PDF file, which will be passed
2256
+ * through to the output buffer of the current PHP page.
2257
+ *
2258
+ * @deprecated 1.2.0 Prefer `convertMultipleFilesToPassthru` instead.
2259
+ *
2260
+ * @param array $inputPaths An array of the input XML or HTML documents.
2261
+ * @param array $msgs An optional array in which to return error and warning
2262
+ * messages.
2263
+ * @param array $dats An optional array in which to return data messages.
2264
+ * @return bool `true` if a PDF file was generated successfully.
2265
+ */
2266
+ public function convert_multiple_files_to_passthru (
2267
+ $ inputPaths ,
2268
+ &$ msgs = array (),
2269
+ &$ dats = array ()
2270
+ ) {
2271
+ $ pathAndArgs = $ this ->getCommandLine ();
2272
+ $ pathAndArgs .= '--structured-log=buffered ' ;
2273
+
2274
+ foreach ($ inputPaths as $ inputPath ) {
2275
+ $ pathAndArgs .= '" ' . $ inputPath . '" ' ;
2276
+ }
2277
+
2278
+ $ pathAndArgs .= '-o - ' ;
2279
+
2280
+ return $ this ->fileToPassthru ($ pathAndArgs , $ msgs , $ dats );
2281
+ }
2282
+
2283
+ /**
2284
+ * [DEPRECATED]
2285
+ * Convert an XML or HTML file to a PDF file, which will be passed through
2286
+ * to the output buffer of the current PHP page.
2287
+ *
2288
+ * @deprecated 1.2.0 Prefer `convertFileToPassthru` instead.
2289
+ *
2290
+ * @param string $inputPath The filename of the input XML or HTML document.
2291
+ * @param array $msgs An optional array in which to return error and warning
2292
+ * messages.
2293
+ * @param array $dats An optional array in which to return data messages.
2294
+ * @return bool `true` if a PDF file was generated successfully.
2295
+ */
2296
+ public function convert_file_to_passthru (
2297
+ $ inputPath ,
2298
+ &$ msgs = array (),
2299
+ &$ dats = array ()
2300
+ ) {
2301
+ $ pathAndArgs = $ this ->getCommandLine ();
2302
+ $ pathAndArgs .= '--structured-log=buffered " ' . $ inputPath . '" -o - ' ;
2303
+
2304
+ return $ this ->fileToPassthru ($ pathAndArgs , $ msgs , $ dats );
2305
+ }
2306
+
2307
+ /**
2308
+ * [DEPRECATED]
2309
+ * Convert an XML or HTML string to a PDF file, which will be passed through
2310
+ * to the output buffer of the current PHP page.
2311
+ *
2312
+ * @deprecated 1.2.0 Prefer `convertStringToPassthru` instead.
2313
+ *
2314
+ * @param string $inputString A string containing an XML or HTML document.
2315
+ * @param array $msgs An optional array in which to return error and warning
2316
+ * messages.
2317
+ * @param array $dats An optional array in which to return data messages.
2318
+ * @return bool `true` if a PDF file was generated successfully.
2319
+ */
2320
+ public function convert_string_to_passthru (
2321
+ $ inputString ,
2322
+ &$ msgs = array (),
2323
+ &$ dats = array ()
2324
+ ) {
2325
+ $ pathAndArgs = $ this ->getCommandLine ();
2326
+ $ pathAndArgs .= '--structured-log=buffered - ' ;
2327
+
2328
+ return $ this ->stringToPassthru ($ pathAndArgs , $ inputString , $ msgs , $ dats );
2329
+ }
2330
+
2331
+ /**
2332
+ * [DEPRECATED]
2333
+ * Convert an XML or HTML string to a PDF file.
2334
+ *
2335
+ * @deprecated 1.2.0 Prefer `convertStringToFile` instead.
2336
+ *
2337
+ * @param string $inputString A string containing an XML or HTML document.
2338
+ * @param string $pdfPath The filename of the output PDF file.
2339
+ * @param array $msgs An optional array in which to return error and warning
2340
+ * messages.
2341
+ * @param array $dats An optional array in which to return data messages.
2342
+ * @return bool `true` if a PDF file was generated successfully.
2343
+ */
2344
+ public function convert_string_to_file (
2345
+ $ inputString ,
2346
+ $ pdfPath ,
2347
+ &$ msgs = array (),
2348
+ &$ dats = array ()
2349
+ ) {
2350
+ $ pathAndArgs = $ this ->getCommandLine ();
2351
+ $ pathAndArgs .= '--structured-log=normal ' ;
2352
+ $ pathAndArgs .= ' - -o " ' . $ pdfPath . '" ' ;
2353
+
2354
+ return $ this ->stringToFile ($ pathAndArgs , $ inputString , $ msgs , $ dats );
2355
+ }
2206
2356
}
0 commit comments