Extraer texto PDF por columnas en orden de lectura
La extracción de texto de un PDF puede recuperar las palabras correctamente y, aun así, entregarlas en una secuencia inútil.
Ejecutar — gratis
En páginas con dos o más columnas, ordenar solo de arriba abajo mezcla párrafos que no guardan relación. Esta capacidad recibe bloques de texto con sus cuadros delimitadores, identifica cuáles pertenecen a la misma columna, ordena las columnas de izquierda a derecha y cada columna de arriba abajo. El resultado incluye el texto reconstruido y toda la geometría ordenada para revisarla o procesarla después.
Cómo usarla
Ingrese sus datos en el formulario de arriba. La herramienta los revisa antes de calcular y muestra el resultado en la misma página.
Revise sus datos
Use las etiquetas y unidades indicadas en cada campo. Si falta algo o un valor está fuera del rango permitido, la página señala qué debe corregir.
Repita el cálculo o automatícelo
Use la herramienta web para comprobaciones individuales y la API cuando necesite integrar la misma capacidad en un flujo automatizado.
Qué puede hacer con ella
Obtenga una respuesta ahora
Ingrese un conjunto de valores y vea el resultado sin preparar una hoja de cálculo ni un script.
Compare escenarios
Cambie un valor a la vez y repita el cálculo para entender qué modifica el resultado.
Automatice el trabajo repetido
Use la API cuando necesite ejecutar el mismo cálculo dentro de su producto o flujo.
Preguntas frecuentes
¿Cómo uso esta capacidad?
Complete los campos de arriba y ejecútela en esta página. El formulario señala cualquier dato que deba corregir.
Para desarrolladores — acceso por API
Todo lo de esta página está disponible por programación. Esta sección es para equipos que quieren integrarlo en sus sistemas; el resto puede usar la herramienta de arriba sin más.
Endpoint de API
¿Prefiere automatizarlo? Un POST autenticado crea la tarea; el resultado llega por webhook o enlace firmado. La misma capacidad también se ejecuta aquí en la web, por email y desde Telegram — y pronto también desde nuestra app.
Llámela desde su stack
curl -X POST https://api.kit.forhosting.com/pdf/text-extract-column-order \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"blocks":[{"text":"Left heading","x":40,"y":40,"width":210,"height":20},{"text":"Right heading","x":320,"y":42,"width":210,"height":20},{"text":"Right body","x":322,"y":90,"width":208,"height":60},{"text":"Left body","x":42,"y":92,"width":208,"height":60}]}'const res = await fetch("https://api.kit.forhosting.com/pdf/text-extract-column-order", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"blocks": [
{
"text": "Left heading",
"x": 40,
"y": 40,
"width": 210,
"height": 20
},
{
"text": "Right heading",
"x": 320,
"y": 42,
"width": 210,
"height": 20
},
{
"text": "Right body",
"x": 322,
"y": 90,
"width": 208,
"height": 60
},
{
"text": "Left body",
"x": 42,
"y": 92,
"width": 208,
"height": 60
}
]
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/pdf/text-extract-column-order",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"blocks": [
{
"text": "Left heading",
"x": 40,
"y": 40,
"width": 210,
"height": 20
},
{
"text": "Right heading",
"x": 320,
"y": 42,
"width": 210,
"height": 20
},
{
"text": "Right body",
"x": 322,
"y": 90,
"width": 208,
"height": 60
},
{
"text": "Left body",
"x": 42,
"y": 92,
"width": 208,
"height": 60
}
]
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/pdf/text-extract-column-order", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"blocks":[{"text":"Left heading","x":40,"y":40,"width":210,"height":20},{"text":"Right heading","x":320,"y":42,"width":210,"height":20},{"text":"Right body","x":322,"y":90,"width":208,"height":60},{"text":"Left body","x":42,"y":92,"width":208,"height":60}]}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"blocks":[{"text":"Left heading","x":40,"y":40,"width":210,"height":20},{"text":"Right heading","x":320,"y":42,"width":210,"height":20},{"text":"Right body","x":322,"y":90,"width":208,"height":60},{"text":"Left body","x":42,"y":92,"width":208,"height":60}]}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/pdf/text-extract-column-order", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Ejemplo de solicitud
{
"blocks": [
{
"text": "Left heading",
"x": 40,
"y": 40,
"width": 210,
"height": 20
},
{
"text": "Right heading",
"x": 320,
"y": 42,
"width": 210,
"height": 20
},
{
"text": "Right body",
"x": 322,
"y": 90,
"width": 208,
"height": 60
},
{
"text": "Left body",
"x": 42,
"y": 92,
"width": 208,
"height": 60
}
]
}Ejemplo de respuesta
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "pdf.text_extract_column_order",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}La API es asíncrona: la llamada devuelve un task_id al instante y el resultado llega por webhook. El polling está limitado a 1 req/s por tarea.
Precio
Precio publicado — sin tokens ni créditos inventados. Una tarea fallida no se cobra.
Límites
max_items | 10000 |
Errores
| HTTP | Código | Significado |
|---|---|---|
401 | unauthorized | API key ausente o inválida. |
402 | insufficient_balance | El saldo no cubre el precio de la tarea. |
404 | unknown_type | El tipo de tarea no existe. |
429 | rate_limited | Demasiadas peticiones. Use el webhook en vez de sondear. |