Use this file to discover all available pages before exploring further.
The edit.run() method fills PDF forms and modifies DOCX documents programmatically. You provide instructions describing what to fill, and Edit populates the document.
from pathlib import Pathfrom reducto import Reductoclient = Reducto()# Upload a formupload = client.upload(file=Path("application.pdf"))# Fill the formresult = client.edit.run( document_url=upload.file_id, edit_instructions="Fill in the name field with 'John Doe' and the date with '12/25/2024'")# Access the filled documentprint(result.document_url) # URL to download filled document
Provide natural language instructions describing what to fill:
result = client.edit.run( document_url=upload.file_id, edit_instructions=""" Fill in the following fields: - Full Name: John Doe - Email: john@example.com - Date: December 25, 2024 - Check the 'I agree' checkbox """)
result = client.edit.run( document_url=upload.file_id, edit_instructions="Fill the form", edit_options={ "color": "#0000FF", # Text color (hex) "enable_overflow_pages": True # Add pages if content overflows })
from reducto import Reductoimport reductotry: result = client.edit.run( document_url=upload.file_id, edit_instructions="Fill the name field" )except reducto.APIConnectionError as e: print(f"Connection failed: {e}")except reducto.APIStatusError as e: print(f"Edit failed: {e.status_code} - {e.response}")