This commit is contained in:
23
docs/snippets/csharp/pdf_only_processor.md
Normal file
23
docs/snippets/csharp/pdf_only_processor.md
Normal file
@@ -0,0 +1,23 @@
|
||||
```csharp title="C#"
|
||||
using Kreuzberg;
|
||||
|
||||
public class PdfOnlyProcessor : IPostProcessor
|
||||
{
|
||||
public string Name() => "pdf-only-processor";
|
||||
public string Version() => "1.0.0";
|
||||
|
||||
public ExtractionResult Process(ExtractionResult result) => result;
|
||||
|
||||
public bool ShouldProcess(ExtractionResult result)
|
||||
=> result.MimeType == "application/pdf";
|
||||
}
|
||||
|
||||
class Program
|
||||
{
|
||||
static void Main()
|
||||
{
|
||||
var processor = new PdfOnlyProcessor();
|
||||
KreuzbergLib.RegisterPostProcessor(processor);
|
||||
}
|
||||
}
|
||||
```
|
||||
Reference in New Issue
Block a user