# Technical Best Practices

## Guidelines For Uploading Files

Following these guidelines will ensure you get the most accurate results as quickly as possible.

### **Reduce very large images**

For faster upload and processing, downscale large images by resizing them.

For example modern smartphones can take images of 24 megapixels or more, in most cases this is completely useless, a waste of bandwidth and processing time.

For the vast majority of image files, 3-5 megapixels is enough. Just make sure the smallest text is legible.

We offer free tooling for compressing and resizing images or PDFs before sending them.\
Details here: [Load and Adjust a File](/integrations/client-libraries-sdk/load-and-adjust-a-file.md#compress-files)

### **Send Only What You Need**

When processing multi-page PDFs, in some cases not all pages are required to be sent for your use case.

For example, on some invoice templates the last page will be terms and conditions, this is typically very dense text that will slow down processing (and cost you money).

We offer free tooling for removing pages from PDFs before sending them.\
Details here: [Load and Adjust a File](/integrations/client-libraries-sdk/load-and-adjust-a-file.md#manipulate-pdf-pages)

### **Do not upscale or enhance**

Never upscale a low-resolution image, adding extra pixels only adds to processing time without an increase in accuracy.\
It is best to avoid very low-resolution images, if possible.

### **Keep the aspect ratio**

Never change the original aspect ratio. Doing so will create distortions and degrade the performance of the OCR.

### Use Text PDFs

Text (or native) PDFs are easier and faster to process. In addition, using a text PDF will provide better accuracy than a scanned (or image) PDF.

## Usage in Web Applications

Our official guideline for Web Applications is to **always** pass your user requests through a server which you control:

* This will prevent leakage of sensitive data.
* You'll be able to much more easily diagnose any issues your users may have.

As such, we **do not recommend** using the Mindee API **directly** in an application running in the final user's web browser.

Users will be **trivially** able to intercept the API Key used for the Mindee requests, and impersonate your account.

{% hint style="info" %}
**In short:&#x20;*****never*****&#x20;do this**. It will only cause suffering.
{% endhint %}

## Usage in Mobile Applications

Our official guideline for Mobile Applications is to strongly prefer passing your user requests through a server which you control:

* You'll benefit from increased security and control.
* You'll be able to much more easily diagnose any issues your users may have.

As such, we **do not recommend** using the Mindee API **directly** in an application running in the final user's mobile device.

Users may be able to obtain your API key from the device.

We recommend cycling through API keys at regular intervals. Depending on your application's setup, it could be problematic to update the API Keys on the device.

Potentially, users interact with the Mindee service outside of your control. This can lead to unexpected overage charges to your account.

Possible exceptions to the recommendation:

* Usage in internal applications on devices or environments you control
* The API Key is easily revocable on the device, and *never* user-accessible

{% hint style="info" %}
**In short: avoid if at all possible**. Only use if you really need it and understand the risks involved.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.mindee.com/integrations/technical-guidelines.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
