@@ -10,46 +10,14 @@ namespace Kevsoft.PDFtk
10
10
/// </summary>
11
11
public interface IPDFtk
12
12
{
13
- /// <summary>
14
- /// Return the number of pages for a given PDF.
15
- /// </summary>
16
- /// <param name="pdfFile">A byte array of the PDF file input.</param>
17
- /// <returns>A result with the number of pages.</returns>
18
- /// See <see cref="GetNumberOfPagesAsync(Stream)"/> to use a PDF input as a stream or <see cref="GetNumberOfPagesAsync(string)"/> to use a PDF file path.
19
- Task < IPDFtkResult < int ? > > GetNumberOfPagesAsync ( byte [ ] pdfFile ) ;
20
-
21
- /// <summary>
22
- /// Return the number of pages for a given PDF.
23
- /// </summary>
24
- /// <param name="pdfFile">A stream containing the PDF file input.</param>
25
- /// <returns>A result with the number of pages.</returns>
26
- /// See <see cref="GetNumberOfPagesAsync(byte[])"/> to use a PDF input as a byte array or <see cref="GetNumberOfPagesAsync(string)"/> to use a PDF file path.
27
- Task < IPDFtkResult < int ? > > GetNumberOfPagesAsync ( Stream pdfFile ) ;
28
-
29
13
/// <summary>
30
14
/// Return the number of pages for a given PDF.
31
15
/// </summary>
32
16
/// <param name="filePath">The PDF file path.</param>
33
17
/// <returns>A result with the number of pages.</returns>
34
- /// See <see cref="GetNumberOfPagesAsync(byte[])"/> to use a PDF input as a byte array.
18
+ /// See <see cref="PDFtkByteArrayExtensions. GetNumberOfPagesAsync(IPDFtk, byte[])"/> to use a PDF input as a byte array.
35
19
Task < IPDFtkResult < int ? > > GetNumberOfPagesAsync ( string filePath ) ;
36
20
37
- /// <summary>
38
- /// Concatenate a list of pages into one single file and returns the output PDF as a byte array.
39
- /// </summary>
40
- /// <param name="pdfFile">A byte array of the PDF file input.</param>
41
- /// <param name="pages">The pages to concatenate.</param>
42
- /// <returns>A result with the PDF as a byte array with the concatenated pages.</returns>
43
- Task < IPDFtkResult < byte [ ] > > GetPagesAsync ( byte [ ] pdfFile , params int [ ] pages ) ;
44
-
45
- /// <summary>
46
- /// Concatenate a list of pages into one single file and returns the output PDF as a byte array.
47
- /// </summary>
48
- /// <param name="pdfFile">A stream of the PDF file input.</param>
49
- /// <param name="pages">The pages to concatenate.</param>
50
- /// <returns>A result with the PDF as a byte array with the concatenated pages.</returns>
51
- Task < IPDFtkResult < byte [ ] > > GetPagesAsync ( Stream pdfFile , params int [ ] pages ) ;
52
-
53
21
/// <summary>
54
22
/// Concatenate a list of pages into one single file and returns the output PDF as a byte array.
55
23
/// </summary>
@@ -58,119 +26,35 @@ public interface IPDFtk
58
26
/// <returns>A result with the PDF as a byte array with the concatenated pages.</returns>
59
27
Task < IPDFtkResult < byte [ ] > > GetPagesAsync ( string filePath , params int [ ] pages ) ;
60
28
61
- /// <summary>
62
- /// Reads the PDF and returns the form field statistics.
63
- /// </summary>
64
- /// <param name="pdfFile">A byte array of the PDF file input.</param>
65
- /// <returns>A result with the form field statistics</returns>
66
- Task < IPDFtkResult < IDataField [ ] > > GetDataFieldsAsync ( byte [ ] pdfFile ) ;
67
-
68
- /// <summary>
69
- /// Reads the PDF and returns the form field statistics.
70
- /// </summary>
71
- /// <param name="pdfFile">A stream of the PDF file input.</param>
72
- /// <returns>A result with the form field statistics</returns>
73
- Task < IPDFtkResult < IDataField [ ] > > GetDataFieldsAsync ( Stream pdfFile ) ;
74
-
75
29
/// <summary>
76
30
/// Reads the PDF and returns the form field statistics.
77
31
/// </summary>
78
32
/// <param name="filePath">The PDF file path.</param>
79
33
/// <returns>A result with the form field statistics</returns>
80
34
Task < IPDFtkResult < IDataField [ ] > > GetDataFieldsAsync ( string filePath ) ;
81
-
82
- /// <summary>
83
- /// Merges multiple PDFs into one single PDF and returns the output PDF as a byte array.
84
- /// </summary>
85
- /// <param name="pdfFiles">An enumeration of bytes of the PDF files to merge.</param>
86
- /// <returns>A result with the PDF as a byte array of the merged PDFs.</returns>
87
- Task < IPDFtkResult < byte [ ] > > ConcatAsync ( IEnumerable < byte [ ] > pdfFiles ) ;
88
-
89
- /// <summary>
90
- /// Merges multiple PDFs into one single PDF and returns the output PDF as a byte array.
91
- /// </summary>
92
- /// <param name="pdfFiles">An enumeration of streams of the PDF files to merge.</param>
93
- /// <returns>A result with the PDF as a byte array of the merged PDFs.</returns>
94
- Task < IPDFtkResult < byte [ ] > > ConcatAsync ( IEnumerable < Stream > pdfFiles ) ;
95
-
35
+
96
36
/// <summary>
97
37
/// Merges multiple PDFs into one single PDF and returns the output PDF as a byte array.
98
38
/// </summary>
99
39
/// <param name="filePaths">An enumeration of the PDF file paths to merge.</param>
100
40
/// <returns>A result with the PDF as a byte array of the merged PDFs.</returns>
101
41
Task < IPDFtkResult < byte [ ] > > ConcatAsync ( IEnumerable < string > filePaths ) ;
102
42
103
- /// <summary>
104
- /// Splits a single PDF in many pages and return an enumeration of bytes representing each page a s single PDF.
105
- /// </summary>
106
- /// <param name="pdfFile">A byte array of the PDF file input.</param>
107
- /// <returns>A result with an enumeration of byte arrays.</returns>
108
- Task < IPDFtkResult < IEnumerable < byte [ ] > > > SplitAsync ( byte [ ] pdfFile ) ;
109
-
110
- /// <summary>
111
- /// Splits a single PDF in many pages and return an enumeration of bytes representing each page a s single PDF.
112
- /// </summary>
113
- /// <param name="pdfFile">A stream of the PDF file input.</param>
114
- /// <returns>A result with an enumeration of byte arrays.</returns>
115
- Task < IPDFtkResult < IEnumerable < byte [ ] > > > SplitAsync ( Stream pdfFile ) ;
116
-
117
43
/// <summary>
118
44
/// Splits a single PDF in many pages and return an enumeration of bytes representing each page a s single PDF.
119
45
/// </summary>
120
46
/// <param name="filePath">The PDF file path.</param>
121
47
/// <returns>A result with an enumeration of byte arrays.</returns>
122
48
Task < IPDFtkResult < IEnumerable < byte [ ] > > > SplitAsync ( string filePath ) ;
123
49
124
- /// <summary>
125
- /// Applies a stamp to a PDF file.
126
- /// </summary>
127
- /// <param name="pdfFile">A byte array of the PDF file input.</param>
128
- /// <param name="stampPdfFile">A byte array of the PDF stamp to apply.</param>
129
- /// <returns>A result with the stamped PDF file.</returns>
130
- Task < IPDFtkResult < byte [ ] > > StampAsync ( byte [ ] pdfFile , byte [ ] stampPdfFile ) ;
131
-
132
- /// <summary>
133
- /// Applies a stamp to a PDF file.
134
- /// </summary>
135
- /// <param name="pdfFile">A stream of the PDF file input.</param>
136
- /// <param name="stampPdfFile">A stream of the PDF stamp to apply.</param>
137
- /// <returns>A result with the stamped PDF file.</returns>
138
- Task < IPDFtkResult < byte [ ] > > StampAsync ( Stream pdfFile , Stream stampPdfFile ) ;
139
-
140
50
/// <summary>
141
51
/// Applies a stamp to a PDF file.
142
52
/// </summary>
143
53
/// <param name="pdfFilePath">A PDF file path.</param>
144
54
/// <param name="stampPdfFilePath">A PDF stamp file path.</param>
145
55
/// <returns>A result with the stamped PDF file.</returns>
146
56
Task < IPDFtkResult < byte [ ] > > StampAsync ( string pdfFilePath , string stampPdfFilePath ) ;
147
-
148
- /// <summary>
149
- /// Fill a PDF form with given data and returns the output PDF as a byte array.
150
- /// </summary>
151
- /// <param name="pdfFile">A byte array of the PDF file input.</param>
152
- /// <param name="fieldData">A key value pair of form field name to value.</param>
153
- /// <param name="flatten">If the final PDF should be flattened.</param>
154
- /// <param name="dropXfa">If the XFA data should be omitted from final PDF.</param>
155
- /// <returns>A result with the PDF form filled as a byte array.</returns>
156
- Task < IPDFtkResult < byte [ ] > > FillFormAsync ( byte [ ] pdfFile ,
157
- IReadOnlyDictionary < string , string > fieldData ,
158
- bool flatten = true ,
159
- bool dropXfa = false ) ;
160
-
161
- /// <summary>
162
- /// Fill a PDF form with given data and returns the output PDF as a byte array.
163
- /// </summary>
164
- /// <param name="pdfFile">A stream of the PDF file input.</param>
165
- /// <param name="fieldData">A key value pair of form field name to value.</param>
166
- /// <param name="flatten">If the final PDF should be flattened.</param>
167
- /// <param name="dropXfa">If the XFA data should be omitted from final PDF.</param>
168
- /// <returns>A result with the PDF form filled as a byte array.</returns>
169
- Task < IPDFtkResult < byte [ ] > > FillFormAsync ( Stream pdfFile ,
170
- IReadOnlyDictionary < string , string > fieldData ,
171
- bool flatten = true ,
172
- bool dropXfa = false ) ;
173
-
57
+
174
58
/// <summary>
175
59
/// Fill a PDF form with given data and returns the output PDF as a byte array.
176
60
/// </summary>
@@ -183,26 +67,7 @@ Task<IPDFtkResult<byte[]>> FillFormAsync(string pdfFilePath,
183
67
IReadOnlyDictionary < string , string > fieldData ,
184
68
bool flatten = true ,
185
69
bool dropXfa = false ) ;
186
-
187
-
188
- /// <summary>
189
- /// Replaces a page in a PDF with another PDF
190
- /// </summary>
191
- /// <param name="fileBytes">A byte array of the PDF file input.</param>
192
- /// <param name="page">The page to replace</param>
193
- /// <param name="replacementFileBytes">A byte array of the PDF file to replace the page with.</param>
194
- /// <returns>A result with the PDF form filled as a byte array.</returns>
195
- Task < IPDFtkResult < byte [ ] > > ReplacePage ( byte [ ] fileBytes , int page , byte [ ] replacementFileBytes ) ;
196
-
197
- /// <summary>
198
- /// Replaces a page in a PDF with another PDF
199
- /// </summary>
200
- /// <param name="pdfFile">A stream of the PDF file input.</param>
201
- /// <param name="page">The page to replace</param>
202
- /// <param name="replacementPdfFile">A stream of the PDF file to replace the page with.</param>
203
- /// <returns>A result with the PDF form filled as a byte array.</returns>
204
- Task < IPDFtkResult < byte [ ] > > ReplacePage ( Stream pdfFile , int page , Stream replacementPdfFile ) ;
205
-
70
+
206
71
/// <summary>
207
72
/// Replaces a page in a PDF with another PDF
208
73
/// </summary>
0 commit comments