4
4
5
5
namespace Kevsoft . PDFtk
6
6
{
7
+ /// <summary>
8
+ /// The main <c>IPDFtk</c> interface.
9
+ /// Contains all methods for performing the PDFtk functions.
10
+ /// </summary>
7
11
public interface IPDFtk
8
12
{
9
- Task < IPDFtkResult < int ? > > GetNumberOfPagesAsync ( byte [ ] pdfFileBytes ) ;
10
- Task < IPDFtkResult < int ? > > GetNumberOfPagesAsync ( Stream pdfFileStream ) ;
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
+ /// <summary>
30
+ /// Return the number of pages for a given PDF.
31
+ /// </summary>
32
+ /// <param name="filePath">The PDF file path.</param>
33
+ /// <returns>A result with the number of pages.</returns>
34
+ /// See <see cref="GetNumberOfPagesAsync(byte[])"/> to use a PDF input as a byte array.
11
35
Task < IPDFtkResult < int ? > > GetNumberOfPagesAsync ( string filePath ) ;
12
- Task < IPDFtkResult < byte [ ] > > GetPagesAsync ( byte [ ] pdfFileBytes , params int [ ] pages ) ;
13
- Task < IPDFtkResult < byte [ ] > > GetPagesAsync ( Stream pdfFileBytes , params int [ ] pages ) ;
14
- Task < IPDFtkResult < byte [ ] > > GetPagesAsync ( string inputFile , params int [ ] pages ) ;
15
- Task < IPDFtkResult < IDataField [ ] > > GetDataFieldsAsync ( byte [ ] pdfFileBytes ) ;
36
+
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
+ /// <summary>
54
+ /// Concatenate a list of pages into one single file and returns the output PDF as a byte array.
55
+ /// </summary>
56
+ /// <param name="filePath">The PDF file path.</param>
57
+ /// <param name="pages">The pages to concatenate.</param>
58
+ /// <returns>A result with the PDF as a byte array with the concatenated pages.</returns>
59
+ Task < IPDFtkResult < byte [ ] > > GetPagesAsync ( string filePath , params int [ ] pages ) ;
60
+
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>
16
73
Task < IPDFtkResult < IDataField [ ] > > GetDataFieldsAsync ( Stream pdfFile ) ;
74
+
75
+ /// <summary>
76
+ /// Reads the PDF and returns the form field statistics.
77
+ /// </summary>
78
+ /// <param name="filePath">The PDF file path.</param>
79
+ /// <returns>A result with the form field statistics</returns>
17
80
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>
18
87
Task < IPDFtkResult < byte [ ] > > ConcatAsync ( IEnumerable < byte [ ] > pdfFiles ) ;
19
- Task < IPDFtkResult < byte [ ] > > ConcatAsync ( IEnumerable < Stream > pdfStreams ) ;
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
+
96
+ /// <summary>
97
+ /// Merges multiple PDFs into one single PDF and returns the output PDF as a byte array.
98
+ /// </summary>
99
+ /// <param name="filePaths">An enumeration of the PDF file paths to merge.</param>
100
+ /// <returns>A result with the PDF as a byte array of the merged PDFs.</returns>
20
101
Task < IPDFtkResult < byte [ ] > > ConcatAsync ( IEnumerable < string > filePaths ) ;
102
+
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>
21
108
Task < IPDFtkResult < IEnumerable < byte [ ] > > > SplitAsync ( byte [ ] pdfFile ) ;
22
- Task < IPDFtkResult < IEnumerable < byte [ ] > > > SplitAsync ( Stream stream ) ;
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
+ /// <summary>
118
+ /// Splits a single PDF in many pages and return an enumeration of bytes representing each page a s single PDF.
119
+ /// </summary>
120
+ /// <param name="filePath">The PDF file path.</param>
121
+ /// <returns>A result with an enumeration of byte arrays.</returns>
23
122
Task < IPDFtkResult < IEnumerable < byte [ ] > > > SplitAsync ( string filePath ) ;
123
+
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>
24
130
Task < IPDFtkResult < byte [ ] > > StampAsync ( byte [ ] pdfFile , byte [ ] stampPdfFile ) ;
25
- Task < IPDFtkResult < byte [ ] > > StampAsync ( Stream pdfFileStream , Stream stampPdfFileStream ) ;
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
+ /// <summary>
141
+ /// Applies a stamp to a PDF file.
142
+ /// </summary>
143
+ /// <param name="pdfFilePath">A PDF file path.</param>
144
+ /// <param name="stampPdfFilePath">A PDF stamp file path.</param>
145
+ /// <returns>A result with the stamped PDF file.</returns>
26
146
Task < IPDFtkResult < byte [ ] > > StampAsync ( string pdfFilePath , string stampPdfFilePath ) ;
27
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>
28
156
Task < IPDFtkResult < byte [ ] > > FillFormAsync ( byte [ ] pdfFile ,
29
157
IReadOnlyDictionary < string , string > fieldData ,
30
- bool flatten ,
31
- bool dropXfa ) ;
158
+ bool flatten = true ,
159
+ bool dropXfa = false ) ;
32
160
33
- Task < IPDFtkResult < byte [ ] > > FillFormAsync ( Stream stream ,
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 ,
34
170
IReadOnlyDictionary < string , string > fieldData ,
35
- bool flatten ,
36
- bool dropXfa ) ;
171
+ bool flatten = true ,
172
+ bool dropXfa = false ) ;
37
173
174
+ /// <summary>
175
+ /// Fill a PDF form with given data and returns the output PDF as a byte array.
176
+ /// </summary>
177
+ /// <param name="pdfFilePath">A PDF file path.</param>
178
+ /// <param name="fieldData">A key value pair of form field name to value.</param>
179
+ /// <param name="flatten">If the final PDF should be flattened.</param>
180
+ /// <param name="dropXfa">If the XFA data should be omitted from final PDF.</param>
181
+ /// <returns>A result with the PDF form filled as a byte array.</returns>
38
182
Task < IPDFtkResult < byte [ ] > > FillFormAsync ( string pdfFilePath ,
39
183
IReadOnlyDictionary < string , string > fieldData ,
40
- bool flatten ,
41
- bool dropXfa ) ;
184
+ bool flatten = true ,
185
+ bool dropXfa = false ) ;
42
186
}
43
187
}
0 commit comments