> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wordware.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Parsing a PDF

> Add the context of a PDF to your prompt

<img src="https://mintcdn.com/wordware/ra7xKdT2WQAz-aM2/images/recipes/parsing-a-pdf/pdf-parse-full.png?fit=max&auto=format&n=ra7xKdT2WQAz-aM2&q=85&s=3dba605a282db373f1b23a4fc4b49c55" alt="File Input Demo" width="2298" height="1584" data-path="images/recipes/parsing-a-pdf/pdf-parse-full.png" />

With Wordware, tasks that would take software engineers hours or days can be done in minutes. In this recipe, we'll
show you how to add a file input, upload a PDF, and how to interact with it in only 5 simple steps, no coding required.

## Steps

<Steps>
  <Step title="Create a New File Input">
    Start by creating a new Input. Select Input type "PDF / Document File". Don't forget to give your input a name for clarity! I called mine PDF, but it could also make sense to indicate what it is, like "resume" or "report".

    <img src="https://mintcdn.com/wordware/ra7xKdT2WQAz-aM2/images/recipes/parsing-a-pdf/pdf-add-input.png?fit=max&auto=format&n=ra7xKdT2WQAz-aM2&q=85&s=be087740b964311b552c3a33be0222bd" alt="File Input Demo" width="2296" height="1374" data-path="images/recipes/parsing-a-pdf/pdf-add-input.png" />
  </Step>

  <Step title="Mention the File Input in the Flow">
    In the editor, type `@` to bring up the mention options, and select the PDF Input you just created.

    <img src="https://mintcdn.com/wordware/ra7xKdT2WQAz-aM2/images/recipes/parsing-a-pdf/pdf-mention-select.png?fit=max&auto=format&n=ra7xKdT2WQAz-aM2&q=85&s=aa8c5adc6b5af733c1b786d791057d40" alt="File Input Demo" width="2300" height="1380" data-path="images/recipes/parsing-a-pdf/pdf-mention-select.png" />

    Now any generation after this PDF will automatically include the PDF as context.

    <img src="https://mintcdn.com/wordware/ra7xKdT2WQAz-aM2/images/recipes/parsing-a-pdf/pdf-add-mention.png?fit=max&auto=format&n=ra7xKdT2WQAz-aM2&q=85&s=e64205e091d7b123c95aa46514454a48" alt="File Input Demo" width="2298" height="1376" data-path="images/recipes/parsing-a-pdf/pdf-add-mention.png" />
  </Step>

  <Step title="Add a generation, upload the file and run the flow!">
    If you haven't already, add an instruction to the flow. And then add a new generation node by typing `/generation` in the editor.

    <img src="https://mintcdn.com/wordware/ra7xKdT2WQAz-aM2/images/recipes/parsing-a-pdf/pdf-generation.png?fit=max&auto=format&n=ra7xKdT2WQAz-aM2&q=85&s=cf4efc324566f84b69e5dec34a39fa87" alt="File Input Demo" width="2300" height="1372" data-path="images/recipes/parsing-a-pdf/pdf-generation.png" />

    We recommend using a model that accepts PDF's natively, like the Gemini Models or Sonnet 3.5/3.7. You can filter by PDF capabilities in the model selector. All models work, but these tend to perform better.
  </Step>

  <Step title="Add your PDF">
    If you press run the sidebar will open up and you can select the PDF you want to run the flow with.

    <img src="https://mintcdn.com/wordware/ra7xKdT2WQAz-aM2/images/recipes/parsing-a-pdf/pdf-input-set.png?fit=max&auto=format&n=ra7xKdT2WQAz-aM2&q=85&s=d678878e6a3904e1e75dc41fdcd4b260" alt="File Input Demo" width="2302" height="1378" data-path="images/recipes/parsing-a-pdf/pdf-input-set.png" />

    Select your desired PDF

    <img src="https://mintcdn.com/wordware/ra7xKdT2WQAz-aM2/images/recipes/parsing-a-pdf/pdf-selected-input.png?fit=max&auto=format&n=ra7xKdT2WQAz-aM2&q=85&s=b96a22f529e51c85d1ed70a289689ff7" alt="File Input Demo" width="2298" height="1382" data-path="images/recipes/parsing-a-pdf/pdf-selected-input.png" />

    And now you are ready to run the flow!
  </Step>

  <Step title="Running the flow">
    Now just run the flow and after a few seconds the model will start streaming the output based on the PDF you added.

    <img src="https://mintcdn.com/wordware/ra7xKdT2WQAz-aM2/images/recipes/parsing-a-pdf/pdf-running.png?fit=max&auto=format&n=ra7xKdT2WQAz-aM2&q=85&s=17a3366bcf44e521b6b396d817d46224" alt="File Input Demo" width="2296" height="1380" data-path="images/recipes/parsing-a-pdf/pdf-running.png" />

    It is that easy!
  </Step>
</Steps>
