> For the complete documentation index, see [llms.txt](https://docs.rayon.design/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rayon.design/core-concepts/work-with-ai/ai-use-cases/clean-a-pdf.md). Agents can also search and read this documentation through its [MCP server](https://docs.rayon.design/~gitbook/mcp).

# Clean a PDF

Turn a PDF into a clean Rayon file.

Turn an imported PDF into a **clean Rayon file**, with walls traced, entities on the right layers, and items converted to blocks.

**Goal** — Turn a PDF into a clean Rayon file.\
**Time to completion** — \~4 min\
**Save** \~120 to 170 min compared with doing it manually

### In a single prompt

This can be done in **one shot**: with a single prompt, the agent turns the imported PDF into a clean Rayon file on its own.

**Prompt**

{% code overflow="wrap" %}

```
Clean up and structure both plans:
- Remove all title blocks, page borders, and annotations, keeping only the plans.
- Organize the remaining shapes into clearly named layers by entity type, such as walls, furniture, and fixtures.
- Trace all walls and openings using Rayon’s native wall and opening tools, matching the reference geometry as closely as possible. Place them together on a new layer named “Walls & Openings” and remove the original geometry they replace.
- Create a separate block for each piece of furniture, fixture, and fitting.
- Add a light grey zone to every room across both plans, following each room’s internal boundaries. Place all zones on a layer named “Zones.”
```

{% endcode %}

{% embed url="<https://player.vimeo.com/video/1247926055?background=1&autoplay=1&loop=1&muted=1&controls=0>" %}

### Step-by-step

To keep control over each stage, follow the step-by-step version below.

{% stepper %}
{% step %}

#### Trace the walls

The agent **traces the walls** over the imported PDF.

**Prompt**

{% code overflow="wrap" %}

```
Trace all the walls on the imported PDF.
```

{% endcode %}
{% endstep %}

{% step %}

#### Set entities on the right layers

Each traced entity is moved to the **correct semantic layer**. The layers are created on purpose.

**Prompt**

{% code overflow="wrap" %}

```
Put every entity on the correct semantic layer, and create the layers that are missing.
```

{% endcode %}
{% endstep %}

{% step %}

#### Convert items to blocks

Repeated items are **converted to blocks**, so they can be counted and edited in one go.

**Prompt**

{% code overflow="wrap" %}

```
Convert the repeated items (doors, windows, fixtures, furniture) to blocks.
```

{% endcode %}
{% endstep %}
{% endstepper %}

***

### We are always available

Book a demo with our team, [right here](https://b1kzip68v9f.typeform.com/to/Hgr0eQ4k#source=docs).\
To get some support, reach out to us through our **in-app support chat**.\
More about [our support policy right here](https://docs.rayon.design/other-resources/others/support-policy.md).
