25 lines
672 B
Markdown
25 lines
672 B
Markdown
```dart title="Dart"
|
|
import 'package:kreuzberg/kreuzberg.dart';
|
|
|
|
Future<void> main() async {
|
|
final config = ExtractionConfig(
|
|
useCache: true,
|
|
enableQualityProcessing: true,
|
|
forceOcr: false,
|
|
disableOcr: false,
|
|
tokenReduction: const TokenReductionOptions(
|
|
mode: 'moderate',
|
|
preserveImportantWords: true,
|
|
),
|
|
resultFormat: ResultFormat.unified,
|
|
outputFormat: OutputFormat.plain(),
|
|
includeDocumentStructure: false,
|
|
maxArchiveDepth: 3,
|
|
useLayoutForMarkdown: false,
|
|
);
|
|
|
|
final result = await KreuzbergBridge.extractFile('document.pdf', null, config);
|
|
print('Reduced content length: ${result.content.length}');
|
|
}
|
|
```
|