# Capture & Parse PDF file

**URL:** <https://forum.cloverdx.com/t/capture-parse-pdf-file/3224>\
**Category:** Resolved Cases\
**Created:** [March 19, 2025, 12:04pm UTC](https://forum.cloverdx.com/t/capture-parse-pdf-file/3224 "2025-03-19T12:04:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![CloverDX\_team](https://yyz1.discourse-cdn.com/flex007/user_avatar/forum.cloverdx.com/cloverdx_team/32/191_2.png) [@CloverDX\_team](https://forum.cloverdx.com/u/CloverDX_team)\
**Post date:** [March 19, 2025, 12:04pm UTC](https://forum.cloverdx.com/t/capture-parse-pdf-file/3224/1 "2025-03-19T12:04:29Z")

</div>

We are building a flow where I need to download a file from an sFTP site and parse it into a Base64 string before sending it to a REST API endpoint.

I can’t seem to find a suitable reader so I can then use the **byte2base64** function. Do we need to create our own PDF reader?

---

<div class="post-metadata">

**Author:** ![CloverDX\_team](https://yyz1.discourse-cdn.com/flex007/user_avatar/forum.cloverdx.com/cloverdx_team/32/191_2.png) [@CloverDX\_team](https://forum.cloverdx.com/u/CloverDX_team)\
**Post date:** [March 19, 2025, 1:53pm UTC](https://forum.cloverdx.com/t/capture-parse-pdf-file/3224/5 "2025-03-19T13:53:14Z")

</div>

That’s correct, we currently do not have a PDF reader that directly extracts text from PDFs. However, we can transfer any file, including a .pdf file, as bytes.

Here is how to do it:

1. **Set the URL** to the .pdf file in the **FlatFileReader** and connect it to a **Map** component.
2. **Edit Metadata**

- Double-click the edge on the output port of the FlatFileReader
- Set the **Type** of the output **field** to **Byte**.
- Select the metadata.
- In properties remove **Record delimiter**  **Default delimiter** and set **EOF as delimiter** to **true**.

 ![inlineImage](https://canada1.discourse-cdn.com/flex007/uploads/cloverdx1/original/1X/0e78971aad76bd04df4f2844e92360f2fb1fde2c.png)

1. In the Map component, apply the transformation using the byte2base64 function to convert the file to a Base64 string and send it to the output port.

 ![inlineImage2](https://canada1.discourse-cdn.com/flex007/uploads/cloverdx1/original/1X/74297b7e9c59d8f1f8b05770e3764e12cbbece28.png)

For better understanding, we are attaching an example graph to the answer.

[Base64.grf](https://forum.cloverdx.com/uploads/short-url/pPYM07N0ML3lDKgcNmtBUCP0QvG.grf) (2.3 KB)
