@@ -55,9 +55,16 @@ public async Task<IPDFtkResult<byte[]>> GetPagesAsync(string inputFile, params i
55
55
56
56
var pageRanges = GetPageRangeArgs ( pages ) ;
57
57
58
- var executeProcessResult = await _pdftkProcess . ExecuteAsync ( inputFile , "cat" ,
59
- string . Join ( " " , pageRanges ) ,
60
- "output" , outputFile . TempFileName ) ;
58
+ var args = new List < string > ( 4 + pages . Length ) ;
59
+ args . Add ( inputFile ) ;
60
+ args . Add ( "cat" ) ;
61
+
62
+ args . AddRange ( pageRanges ) ;
63
+
64
+ args . Add ( "output" ) ;
65
+ args . Add ( outputFile . TempFileName ) ;
66
+
67
+ var executeProcessResult = await _pdftkProcess . ExecuteAsync ( args . ToArray ( ) ) ;
61
68
62
69
return await ResolveSingleFileExecutionResultAsync ( executeProcessResult , outputFile ) ;
63
70
}
@@ -117,10 +124,9 @@ public async Task<IPDFtkResult<byte[]>> ConcatAsync(IEnumerable<string> filePath
117
124
{
118
125
using var outputFile = TempPDFtkFile . Create ( ) ;
119
126
120
- var inputFileNames = string . Join ( " " , filePaths ) ;
121
-
122
127
var executeProcessResult =
123
- await _pdftkProcess . ExecuteAsync ( inputFileNames , "cat" , "output" , outputFile . TempFileName ) ;
128
+ await _pdftkProcess . ExecuteAsync ( filePaths . Concat ( new [ ] { "cat" , "output" , outputFile . TempFileName } )
129
+ . ToArray ( ) ) ;
124
130
125
131
return await ResolveSingleFileExecutionResultAsync ( executeProcessResult , outputFile ) ;
126
132
}
@@ -142,8 +148,7 @@ public async Task<IPDFtkResult<IReadOnlyCollection<KeyValuePair<string, byte[]>>
142
148
public async Task < IPDFtkResult < byte [ ] > > StampAsync ( string pdfFilePath , string stampPdfFilePath )
143
149
{
144
150
using var outputFile = TempPDFtkFile . Create ( ) ;
145
-
146
-
151
+
147
152
var executeProcessResult = await _pdftkProcess . ExecuteAsync ( pdfFilePath ,
148
153
"multistamp" , stampPdfFilePath ,
149
154
"output" , outputFile . TempFileName ) ;
0 commit comments