# How to Enable Technical Mode for PDF Extraction in book-to-skill

> Learn how to enable technical mode for PDF extraction in book-to-skill. Preserve tables, code blocks, and complex formatting with this simple command.

- Repository: [Virgilio Junior/book-to-skill](https://github.com/virgiliojr94/book-to-skill)
- Tags: how-to-guide
- Published: 2026-09-01

---

**Enable technical mode by passing `--mode technical` to [`scripts/extract.py`](https://github.com/virgiliojr94/book-to-skill/blob/main/scripts/extract.py) to switch from plain-text extraction to Docling's layout-aware parser that preserves tables, code blocks, and complex formatting.**

The `book-to-skill` repository provides a dual-pipeline PDF extraction system designed to handle both narrative books and complex technical documents. By default, the tool uses a lightweight text extractor, but technical mode activates **Docling**—a specialized backend that understands document structure. This guide walks through exactly how to enable and use this feature based on the current source code implementation.

## What Technical Mode Does

`book-to-skill` offers two extraction modes controlled by the same CLI flag:

| Mode | Pipeline | Best For |
|------|----------|----------|
| **text** (default) | `pdftotext` chain | Fiction, narrative prose, simple layouts |
| **technical** | **Docling** | Manuals, textbooks, code snippets, formulas, multi-column layouts |

In [`book_to_skill/parsers/pdf.py`](https://github.com/virgiliojr94/book-to-skill/blob/main/book_to_skill/parsers/pdf.py), the extraction logic branches based on the `extraction_mode` parameter. When set to `"technical"`, the parser initializes Docling's layout-aware engine instead of falling back to plain-text conversion. The docstring in that file explicitly notes this mode is "Best for technical books" containing structured elements.

## Where the Mode Is Configured

The mode configuration flows through three key files:

- **[`book_to_skill/utils.py`](https://github.com/virgiliojr94/book-to-skill/blob/main/book_to_skill/utils.py)** (lines 75-78): Defines the default value `"text"` and parses user overrides (lines 84-86)
- **[`scripts/extract.py`](https://github.com/virgiliojr94/book-to-skill/blob/main/scripts/extract.py)**: CLI entry point that passes the mode to the extraction pipeline
- **[`book_to_skill/parsers/pdf.py`](https://github.com/virgiliojr94/book-to-skill/blob/main/book_to_skill/parsers/pdf.py)**: Executes the actual mode selection at runtime

The `parse_arguments()` function in [`utils.py`](https://github.com/virgiliojr94/book-to-skill/blob/main/utils.py) also prints a banner confirming your selection: `Mode: technical — using Docling …`

## Enable Technical Mode via CLI

Add the `--mode technical` flag to any extraction command:

```bash

# Default text extraction

python scripts/extract.py my_book.pdf

# Enable technical mode for complex documents

python scripts/extract.py my_tech_manual.pdf --mode technical

```

### Skip Dependency Installation Prompts

Docling is an optional dependency declared in [`book_to_skill/dependencies.py`](https://github.com/virgiliojr94/book-to-skill/blob/main/book_to_skill/dependencies.py). If already installed, suppress automatic installation checks:

```bash
python scripts/extract.py manual.pdf --mode technical --install-missing no

```

## Enable Technical Mode Programmatically

Import `parse_arguments` directly to configure mode in Python code:

```python
from book_to_skill.utils import parse_arguments

# Simulate CLI arguments

argv = ["extract.py", "technical_manual.pdf", "--mode", "technical"]
input_paths, mode, install = parse_arguments(argv)

# mode == "technical" — pass to PDF parser

print(f"Extraction mode: {mode}")

```

This returns the parsed mode string that you would pass to the `PDF` parser class in [`book_to_skill/parsers/pdf.py`](https://github.com/virgiliojr94/book-to-skill/blob/main/book_to_skill/parsers/pdf.py).

## Dependency Requirements

Technical mode requires the `docling` package. The extraction pipeline handles missing dependencies in two ways:

- **Default behavior**: Prompts for automatic installation when Docling is not found
- **With `--install-missing no`**: Skips prompts; fails immediately if `docling` is absent

Install manually ahead of time to avoid interruptions:

```bash
pip install docling

```

## Summary

- **Use `--mode technical`** to activate Docling's layout-aware PDF extraction
- **Default mode is `"text"`** using `pdftotext` for simple documents
- **Three files control the flow**: [`utils.py`](https://github.com/virgiliojr94/book-to-skill/blob/main/utils.py) for parsing, [`extract.py`](https://github.com/virgiliojr94/book-to-skill/blob/main/extract.py) for CLI, [`pdf.py`](https://github.com/virgiliojr94/book-to-skill/blob/main/pdf.py) for execution
- **Docling is optional**—install separately or allow automatic prompts

## Frequently Asked Questions

### What types of PDFs benefit most from technical mode?

Technical PDFs containing tables, code blocks, mathematical formulas, or multi-column layouts. Docling preserves structural relationships that `pdftotext` flattens into unstructured text.

### Where is the default extraction mode defined?

In [`book_to_skill/utils.py`](https://github.com/virgiliojr94/book-to-skill/blob/main/book_to_skill/utils.py) at lines 75-78, where the argument parser sets `default="text"` for the `--mode` parameter.

### What happens if Docling is not installed when I use technical mode?

By default, the system prompts you to install missing dependencies. Pass `--install-missing no` to disable this behavior and receive an immediate error instead.

### Can I switch modes without modifying code?

Yes—technical mode is fully controlled by the CLI flag. No configuration files or environment variables are required; simply add or remove `--mode technical` from your command.