# Extract text from a government PDF form as Markdown

**Use case:** 

Pulls the instructions and field labels out of an official PDF form and returns them as Markdown, so an agent or script can read the form without a PDF library. This example converts the IRS W-9 form. Replace the URL with any public PDF form or notice.

## Input

```json
{
  "urls": [
    "https://www.irs.gov/pub/irs-pdf/fw9.pdf"
  ],
  "pageRange": ""
}
```

## Output

```json
{
  "status": {
    "label": "Status",
    "format": "string"
  },
  "input": {
    "label": "Input",
    "format": "string"
  },
  "title": {
    "label": "Title",
    "format": "string"
  },
  "format": {
    "label": "Format",
    "format": "string"
  },
  "pageCount": {
    "label": "Page count",
    "format": "integer"
  },
  "billablePages": {
    "label": "Billable Pages",
    "format": "integer"
  },
  "markdown": {
    "label": "Markdown",
    "format": "string"
  },
  "tables": {
    "label": "Tables",
    "format": "array"
  },
  "textlessPages": {
    "label": "Textless PDF pages",
    "format": "array"
  },
  "reason": {
    "label": "Reason",
    "format": "string"
  },
  "source": {
    "label": "Source URL",
    "format": "string"
  },
  "fetchedAt": {
    "label": "Fetched at",
    "format": "string"
  }
}
```

## How it works

### 1. Sign up on Apify or log in

The PDF to Markdown & Office File Converter Actor is ready to run with the inputs already set for "Extract text from a government PDF form as Markdown". [Sign up or log in](https://console.apify.com/create-task-from-example/KNmvPjTbuHMV4ENIH) and you'll land in Apify Console with a copy of this exact task.

### 2. Start the "Extract text from a government PDF form as Markdown" task

The PDF to Markdown & Office File Converter Actor will start running based on the input automatically. You can also change all the input fields, like file urls, to match your specific use case.

### 3. Receive the "Extract text from a government PDF form as Markdown" output

Monitor the progress in real time. You will be notified as soon as your dataset is complete and ready for review. Each result includes data such as status, input, title, and more.

### 4. Integrate into your workflow

The final output is delivered in JSON, CSV, or Excel format, ready to be plugged into your workflow. You can also [run the "Extract text from a government PDF form as Markdown" task via API](https://apify.com/miacx/pdf-to-markdown-office-converter.md).

## FAQ

### What does the government PDF form task return?

The government PDF form task returns the form's text as Markdown, with its headings, instructions and field labels in reading order, plus the source URL.

### Does the government PDF form task fill in forms?

No. The government PDF form task only extracts the text of a PDF. It doesn't fill in or submit forms.

### What if the PDF is a scan?

A scanned PDF has no text layer, so the government PDF form task returns little or no text for it. The task doesn't run OCR.

## About this Actor

This example demonstrates how to use [PDF to Markdown & Office File Converter](https://apify.com/miacx/pdf-to-markdown-office-converter.md) with a specific input configuration. Visit the [Actor detail page](https://apify.com/miacx/pdf-to-markdown-office-converter.md) to learn more, explore other use cases, and run it yourself.


## How to integrate an Actor?

This Task's input is already configured above. Use it as-is rather than inventing a new one.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For full API examples (JavaScript, Python, CLI, MCP, OpenAPI), see this Task's Actor page: https://apify.com/miacx/pdf-to-markdown-office-converter.md

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).
