@@ -222,7 +222,8 @@ public async Task<IPDFtkResult<byte[]>> ReplacePage(string pdfFilePath, int page
222
222
}
223
223
224
224
/// <inheritdoc/>
225
- public async Task < IPDFtkResult < byte [ ] > > ReplacePages ( string pdfFilePath , int startPage , int endPage , string replacementFilePath )
225
+ public async Task < IPDFtkResult < byte [ ] > > ReplacePages ( string pdfFilePath , int startPage , int endPage ,
226
+ string replacementFilePath )
226
227
{
227
228
var range = new Range ( startPage , endPage ) ;
228
229
var numberOfPagesAsync = await GetNumberOfPagesAsync ( pdfFilePath ) ;
@@ -231,7 +232,8 @@ public async Task<IPDFtkResult<byte[]>> ReplacePages(string pdfFilePath, int sta
231
232
232
233
var totalPages = numberOfPagesAsync . Result ;
233
234
if ( ! range . IsValid || ! range . IsInBounds ( totalPages ) )
234
- throw new ArgumentException ( $ "Invalid range of pages to replace, min page is 1 and maximum is { totalPages } ") ;
235
+ throw new ArgumentException (
236
+ $ "Invalid range of pages to replace, min page is 1 and maximum is { totalPages } ") ;
235
237
236
238
var bounds = ( firstPage : range . HasFirst ( ) , lastPage : range . HasLast ( totalPages ) ) switch
237
239
{
@@ -255,7 +257,9 @@ public async Task<IPDFtkResult<byte[]>> ReplacePages(string pdfFilePath, int sta
255
257
return await ResolveSingleFileExecutionResultAsync ( executeProcessResult , outputFile ) ;
256
258
}
257
259
258
- public async Task < IPDFtkResult < IEnumerable < KeyValuePair < string , byte [ ] > > > > ExtractAttachments ( string pdfFilePath )
260
+ /// <inheritdoc/>
261
+ public async Task < IPDFtkResult < IEnumerable < KeyValuePair < string , byte [ ] > > > > ExtractAttachments (
262
+ string pdfFilePath )
259
263
{
260
264
using var outputDirectory = TempPDFtkDirectory . Create ( ) ;
261
265
@@ -268,7 +272,7 @@ public async Task<IPDFtkResult<IEnumerable<KeyValuePair<string, byte[]>>>> Extra
268
272
269
273
return await ResolveSingleDirectoryExecutionResultAsync ( executeProcessResult , outputDirectory , "*" ) ;
270
274
}
271
-
275
+
272
276
private class Range
273
277
{
274
278
public int Start { get ; }
@@ -280,5 +284,6 @@ private class Range
280
284
public bool HasFirst ( ) => HasFirst ( 1 ) ;
281
285
public bool HasFirst ( int ? first ) => Start == first ;
282
286
public bool HasLast ( int ? last ) => End == last ;
287
+ }
283
288
}
284
289
}
0 commit comments