Advanced AI Document Editing with Hatz
Hatz has upgraded the Code Interpreter to support Advanced AI Document Editing. This update unlocks powerful document manipulation capabilities, allowing you to seamlessly edit, create, and analyze documents, presentations, and spreadsheets directly within your chat or workflow.
Getting Started
This feature is integrated directly into the core Hatz experience.
No Setup Required: You do not need to enable specific tool toggles.
Native Integration: It works automatically without requiring the "Auto-tool" toggle.
Editing Older Uploads: Documents uploaded before this feature was enabled may not be editable. This includes files in existing chats, and constants referenced in Agents, Apps and Workflows. If you encounter an error, please re-upload the document and try again.
How to Use (Quick Start)
Upload: Drag and drop your document or spreadsheet into the chat (or use it as a constant in an App, Agent, or Workflow).
Prompt: Tell Hatz exactly what you want changed, analyzed, or produced.
Download: Hatz will process the file using code execution and provide a secure download link for your updated version.
Supported File Types
To ensure successful editing, please use the following modern formats.
File Type | Extension |
Documents | .docx, .pdf, .pptx |
Spreadsheets | .csv, .xlsx |
Note on Legacy Files: Old formats like .doc, .xls, and .ppt are not supported. Please open these in Microsoft Office and "Save As" their modern equivalents (.docx, .xlsx, .pptx) before uploading.
Capabilities by File Type
Word Documents (.docx)
Intelligent Text Editing: Replace or insert text content while preserving paragraph structure and formatting.
Review Comments: Add review comments to specific sections of the document.
Advanced Edits: Apply advanced edits using OOXML for tracked changes or redlining when needed.
Global Formatting: Update fonts, headers, and styles across the entire document instantly.
Content Generation: Generate entirely new reports, insert images, or update tables based on your instructions.
Spreadsheets (.csv / .xlsx / .xls)
Data Hygiene: Clean complex datasets, standardize formats, and remove duplicates.
Deep Analysis: Calculate metrics, generate summary tables (e.g., sales totals by region), and create charts.
Mass Merging: Combine multiple CSVs or Excel sheets into one master file using join logic.
Formula Recalculation: Recalculate formulas using a backed calculation engine.
Error Detection: Identify formula errors like #REF! or #DIV/0!.
PowerPoint Presentations (.pptx)
Text Replacement: Replace text across multiple slides instantly.
Template Automation: Upload a template and a dataset to generate dozens of slides instantly (e.g., one slide per product).
Slide Management: Reorder slides, duplicate slides, or merge multiple decks.
Mass Updates: Find and replace text, update footers, or standardize fonts across slides in seconds.
Asset Extraction: Extract images into a folder or generate slide thumbnails (previews).
Structured Inventory: Get detailed text position inventories for advanced replacement workflows.
PDFs (.pdf)
Text Extraction: Extract text content from PDFs for analysis or conversion.
Fillable Forms: Fill fillable PDF forms (AcroForm fields) programmatically.
Non-Fillable Forms: Fill non-fillable PDFs by placing text overlays (annotations) at specific coordinates.
OCR Support: Use OCR for scanned PDFs (best-effort extraction; accuracy depends on scan quality).
Content Reconstruction: Extract text and tables from a PDF to rebuild them into an editable Word document (.docx).
Structural Control: Merge multiple PDFs, split pages into separate files, rotate pages, or reorder them.
Overlays: Apply watermarks (e.g., "CONFIDENTIAL") or stamp page numbers on existing documents.
Files, Downloads, and Persistence
Original File Preservation: Your original upload is never overwritten. Hatz always creates a brand-new output file for any edits made.
Link Expiration: Download links generated by Hatz typically expire after approximately 1 hour for security. If a link expires, simply ask Hatz to regenerate it.
Environment Pausing: The code execution environment may pause after a period of inactivity to save resources. It will resume automatically as soon as you continue the conversation.
Pro Tip: Iterative Editing
When you want to perform a sequence of edits—such as converting a PDF to Word and then replacing text, or continuously updating a PPTX—you must explicitly tell Hatz to look at the new file. Users may want to upload the newly created file to guarantee changes are included.
Incorrect phrasing: "Now filter the data." (Hatz might look back at your original upload).
Correct phrasing: "Now filter the data in the new file you just created."
Important Notes & Limitations
Password Protection: Hatz cannot process encrypted or password-protected files. Please upload an unlocked copy.
Scanned PDFs: If your PDF is a scanned image rather than digital text, Hatz may not be able to read or edit the content, varies in accuracy.
PDF to Word Conversion: This process extracts text and tables to build a new editable document. It does not perform a pixel-perfect visual conversion. Complex layouts (like magazines or brochures with floating images) may be simplified to linear text to ensure editability.
Excel Pivot Tables: Hatz calculates data summaries (e.g., "Sales by Region") and writes the static results to cells. It does not create interactive Pivot Table objects that allow you to drag and drop fields within Excel.
Visual Fidelity: When converting files, slight shifts in margins, fonts, or image placement are normal as the system reconstructs the document.
Macro-Enabled Files: .xlsm files (macro-enabled Excel) are not supported. Macros will not execute.
Example Prompts to Try
Word Documents
"Replace all instances of 'Acme Corp' with 'Hatz AI'. Keep all headings and table formatting unchanged."
"Add 5 review comments to the paragraphs that mention pricing. Keep comments short and specific."
PowerPoint
"Shorten all slide titles to under 7 words and update the bullet points on slide 3 to match the attached notes."
"Move slide 5 to the beginning and duplicate slide 2 at the end."
"Rebrand this deck: change the primary color of the headers to #0B5FFF, update the footer to 'Q1 2026', and add a title slide. Return the updated .pptx."
PDFs (Fillable Forms)
"Fill this form with the following values: Name = John Smith, Email = [email protected], Checkbox 'I Agree' = Yes, Plan = Pro."
PDFs (Non-Fillable Forms)
"Place these values into the form boxes on page 2. Match the existing font size: Field 1 = 12345, Field 2 = Sample Company, Field 3 = January 2026."
PDFs (General)
"Merge these two PDFs into one, rotate pages 3-5 to portrait, and return the merged PDF."
Spreadsheets
"Create a new column called 'Total' that multiplies quantity by unit_price. Filter to rows where Total > 100. Export as XLSX."
"Recalculate all formulas and tell me if there are any #REF! or #DIV/0! errors."
"Analyze this CSV, calculate month-over-month growth, create a bar chart for the top 5 regions, and return an Excel file plus a PDF summary."
Working with PDFs and Word Documents
Understanding the technical differences between a PDF and a Word Document (.docx) is the key to getting the results you want. While code can perform powerful operations on both formats, the type of operations available differs significantly.
1. Working Directly with PDFs ("Page-Level" Editing)
Think of a PDF as "Digital Paper." Once a PDF is created, the text and images are "baked" into specific coordinates on the page. Because of this, Hatz Code Execution treats the file as a collection of fixed pages rather than a stream of editable words.
What Hatz CAN do directly to a PDF:
Merge & Combine: We can take multiple PDF files (or a PDF and a Word doc) and staple them together into a single document.
Split & Extract: We can slice a document apart. For example, "Extract pages 1–3 into a new file" or "Split every page into its own separate file."
Rotate & Reorder: If pages were scanned upside down or out of order, we can fix the orientation and sequence.
Watermark & Stamp: We can apply overlays on top of the existing page. This is useful for adding "DRAFT," "CONFIDENTIAL," or page numbers.
Security: We can add password protection to encrypt the file.
Fill Fillable Forms: We can programmatically fill AcroForm fields in fillable PDFs.
Fill Non-Fillable Forms: We can place text overlays (annotations) at specific coordinates to "fill" non-fillable PDF forms.
Extract Text: We can extract text content from PDFs for analysis or conversion to other formats.
OCR for Scanned PDFs: We can perform Optical Character Recognition on scanned documents (best-effort; accuracy depends on scan quality).
The Limitation: We generally cannot rewrite a specific sentence inside a PDF without breaking the layout or leaving blank gaps (unless using text overlays, which are coordinate-based).
2. Converting to Word ("Content-Level" Editing)
To perform deep editing, the best workflow is to have Hatz convert the PDF to a Word Document (.docx) first.
Think of a Word Document as a "Fluid Canvas." In this format, the text is alive—it flows, wraps, and adjusts automatically. Converting your PDF to Word "unlocks" a new tier of editing capabilities that are impossible in the PDF format.
What Hatz CAN do once the file is converted to Word:
A. Intelligent Find & Replace
What it is: We can scan the entire document for specific terms and replace them.
Why it works in Word: When we replace a short word (e.g., "USA") with a long phrase (e.g., "The United States of America"), the Word document automatically pushes the rest of the text forward to make room. In a PDF, this would simply type over the existing text.
B. "Reflowing" Content
What it is: Adding or removing large blocks of text.
Why it works in Word: If you ask us to remove a paragraph, the text below it slides up to fill the empty space. If we add a new image, the text wraps around it. This ensures the document never looks "broken."
C. Formatting & Styling
What it is: Changing fonts, colors, headers, and bolding.
Why it works in Word: We can apply global style changes (e.g., "Make all headers Blue and Bold") instantly.
D. Data Analysis
What it is: Extracting lists or tables.
Why it works in Word: Once converted, tables become editable grids. We can extract this data into Excel or reformat the table borders and shading.
Summary Comparison
Feature | Direct PDF Editing | Converted to Word Editing |
Primary Use | Organizing pages, security, archiving, and form filling. | Rewriting text, formatting, and changing content. |
Combine Files? | ✅ Yes (Merge) | ✅ Yes (Append) |
Delete Pages? | ✅ Yes | ✅ Yes |
Delete Paragraphs? | ❌ No (Leaves a blank gap) | ✅ Yes (Text moves up automatically) |
Edit Text? | ⚠️ Limited (Overlays only) | ✅ Yes (Fully editable) |
Fill Forms? | ✅ Yes (Fillable & non-fillable) | N/A |
Extract Text? | ✅ Yes | ✅ Yes |
Change Fonts? | ❌ No | ✅ Yes |
Pro Tip: The "Round Trip" Workflow
If you need a PDF as your final result but need to change the text inside it, ask Hatz to perform a "Round Trip":
Convert the PDF to Word.
Make the necessary text edits in the Word doc.
Save the file back as a PDF.
Known Limitations
While Hatz Code Execution is powerful, file conversion is complex. Please be aware of the following limitations when requesting edits or conversions:
Complex Layouts & Formatting: PDFs with heavy design elements—such as multiple columns, floating images, or background graphics—may not convert perfectly to Word. You may notice text boxes shifting, margins changing, or images moving slightly in the converted file.
Scanned Documents (Images): If your PDF is a scanned image (e.g., a photo of a document) rather than a digital text file, Hatz may not be able to "read" or edit the text without performing Optical Character Recognition (OCR). The accuracy of this depends heavily on the clarity of the scan.
Font Substitutions: PDFs often contain proprietary or custom fonts. When converting to Word or generating new PDFs, Hatz may substitute these with standard system fonts (like Arial or Times New Roman) if the original font is not available in our system.
"Round Trip" Fidelity: If you convert a PDF to Word, edit it, and convert it back to PDF, the final document may not look pixel-perfectly identical to the original. Slight variations in spacing and layout are normal.
PDF Form Rendering: Some PDF viewers don't render filled form values correctly without appearance regeneration. Adobe Acrobat Reader is the most reliable viewer for validating filled forms.
Non-Fillable Form Accuracy: Text overlays on non-fillable PDFs are coordinate-based and may not align perfectly with existing form lines.
Working with PPTX
PowerPoint is the standard for presentations, but manual editing can be tedious and prone to errors. Hatz Code Execution transforms PowerPoint from a static design tool into a dynamic, automatable engine.
By using Python code to interact with your .pptx files, Hatz allows you to perform tasks that would take hours by hand in just a few seconds. Here is how you can use Hatz to scale your presentation workflows.
1. Intelligent Templating & Bulk Generation
This is the true "superpower" of Hatz. Instead of manually copy-pasting data into 50 different slides, you can treat a PowerPoint file as a template.
From Excel to Deck: Upload an Excel spreadsheet (e.g., a list of employees or products) and a single PowerPoint template slide. Hatz can loop through your data and generate a slide presentation, where every slide is perfectly formatted with that specific row's data.
Dynamic Placeholders: You can set up "keys" in your slide (like
{{Client_Name}}or{{Date}}). Hatz can scan the deck and programmatically replace those keys with real values across the entire presentation.Use Cases:
Generating customized sales pitches for 20 different prospects at once.
Creating certificates of completion for a class of 500 students.
Building a product catalog where every slide follows the exact same layout.
2. Instant Global Updates
Hatz provides "Command Center" control over your slides. Because the code iterates through every object on every slide, you can ensure 100% consistency without missing a spot.
Mass Find & Replace: Need to update a project code, a year (2024 → 2025), or a company name across a 100-slide deck? Hatz does it instantly, preserving the original formatting of the text.
Font & Color Standardization: If you have a messy deck where headers are a mix of Arial, Calibri, and Times New Roman, Hatz can enforce a single style rule (e.g., "Make every Title bold, size 24, and blue") across the entire file.
Footer & Note Management: You can instantly append "Confidential - Internal Use Only" to the footer of every slide or clear out all speaker notes before sharing a file externally.
3. Deck Merging & Organization
Stop struggling with "Copy Slide," "Keep Source Formatting," and broken layouts. Hatz manages the file structure cleanly.
Seamless Merging: You can combine multiple separate files (e.g., a "Marketing Update," a "Financial Report," and a "Strategy Deck") into a single, cohesive Master Presentation.
Smart Splitting: Conversely, you can take a massive Master Deck and ask Hatz to "Save slides 1-10 as 'Executive Summary.pptx' and slides 11-30 as 'Appendix.pptx'."
Slide Reordering & Duplication: Reorder slides or duplicate specific slides programmatically.
Asset Extraction: Need the original images from a presentation? Hatz can "unzip" the PowerPoint and give you a folder containing every high-resolution image used in the deck.
Slide Thumbnails: Generate preview thumbnails for individual slides.
4. Data-Driven Charts
Hatz can interact with the data that powers your PowerPoint charts.
Update Chart Data: If you have a standard "Monthly Revenue" slide with a bar chart, you don't need to redraw it. You can provide Hatz with the new numbers for this month, and it can update the underlying data table, causing the chart to reflect the new values automatically.
5. Structured Workflows
Text Position Inventory: Get detailed inventories of text positions across slides for advanced, structured replacement workflows.
Known Limitations
While Hatz offers powerful automation for structure and text, PowerPoint is a visual medium, and code has no "eyes." Please keep the following in mind:
Text Overflow (The "Box" Problem): Code inserts text into the box you tell it to. If you try to put a 500-word paragraph into a small text box designed for a title, the text will run off the bottom of the slide or be cut off. Code does not automatically resize fonts or create new slides to handle overflow.
Complex Layout Reflow: Hatz cannot "intelligently" rearrange a slide layout based on visual balance. For example, if you swap a vertical image for a horizontal one, it might overlap with text or look stretched.
Animations & Transitions: Hatz cannot easily create or modify complex animations (e.g., "Fade in logo after 2 seconds"). These settings are stored in complex XML structures that are risky to modify via code. While animations and transitions are preserved during editing, complex animations may not behave identically after content changes.
SmartArt: SmartArt (hierarchy charts, cycle diagrams) are complex grouped objects. Hatz generally cannot add new nodes or bullets to a SmartArt graphic without breaking it.
File Format: These features work with modern
.pptxfiles. Older.ppt(Binary) files from the Office 97-2003 era must be saved as.pptxbefore Hatz can edit them.
Working with .csv, .xlsx, .xls
Spreadsheets are the backbone of business data, but managing them manually is slow, error-prone, and tedious. Hatz Code Execution changes the game by treating your data as a programmable asset.
Whether you are cleaning messy data, merging complex reports, or performing deep analysis, Hatz can process millions of rows in seconds. Here is how you can unlock the full potential of your data.
1. Instant Data Hygiene & Standardization
Messy data is the enemy of insight. Hatz acts as an automated cleaner that scrubs your data until it sparkles.
Intelligent De-Duplication: Instantly identify and remove duplicate rows based on specific criteria (e.g., "Remove duplicates only if the Email AND Phone Number match").
Format Standardization: Fix those annoying inconsistencies. Hatz can scan columns to ensure all phone numbers follow
(555) 123-4567format, all dates areMM/DD/YYYY, and all names are Title Cased.Fill the Gaps: Hatz can intelligently handle missing data—filling blank cells with "N/A," "0," or even calculating the average of the column to fill the gap.
2. Advanced Transformation & "Magical" Merging
Stop manually copy-pasting or struggling with fragile VLOOKUPs. Hatz handles data relationships with robust logic.
The "Super Merge": Have 3 different CSV files? Hatz can stitch them all together into one Master Workbook in the blink of an eye.
Complex Joins: Hatz can perform SQL-style joins. You can upload a "Sales" sheet and a "Customer" sheet, and Hatz will merge them into a single view based on Customer ID, even if the files are formatted differently.
Splitting & Partitioning: The reverse is also true. Upload a Master Sales Report and ask Hatz to "Create a separate Excel file for every Sales Rep," and it will generate individual files containing only that rep's data.
3. Deep Analysis & Calculation
Hatz turns static rows into actionable insights without you needing to write a single complex formula.
Pivot Tables & Aggregation: Ask Hatz to "Summarize total revenue by Region and Product Category," and it will generate a clean summary table instantly.
Complex Math: Need to apply a complex commission tier logic to 50 rows? Hatz can run the calculation on every row and write the result into a new column—faster and more accurately than drag-filling formulas.
Filtering & Logic: "Keep only rows where the Status is 'Active' and the Date is after Jan 1st." Hatz filters the noise so you can focus on the signal.
Formula Recalculation: Explicitly request formula recalculation using Hatz's backed calculation engine.
Error Detection: Identify and report formula errors like #REF! or #DIV/0!.
4. Professional Styling & Formatting
Once the data is crunched, Hatz can make it look presentation-ready.
Visual Polish: Hatz can apply professional styling to your new spreadsheet—bolding headers, freezing the top row, adjusting column widths to fit the text, and changing font colors.
Conditional Formatting: Hatz can highlight data programmatically. "Highlight any cell in the 'Profit' column that is negative in Red, and anything over $10,000 in Green."
Known Limitations
While Hatz is an incredible tool for data manipulation, Excel files are complex containers. Here are the limitations to keep in mind:
VBA Macros (.xlsm): Hatz generally strips out or ignores VBA Macros; it focuses on the data, not the internal code of the file. Macro-enabled files (.xlsm) are not supported. Macros will not execute.
Images & Objects: If you have floating images, charts, or embedded objects (like a PDF inside an Excel cell), these may be lost or removed during processing. Hatz reads the grid (rows/columns), not the "layer" above it.
Live Formulas vs. Values: When Hatz performs a calculation (e.g., adding Column A + Column B), it typically writes the result (e.g., "10") into the cell, not the formula (e.g.,
=SUM(A1, B1)). This ensures the data is correct, but it means the cell won't update dynamically if you change the inputs later.Password Protection: Hatz cannot open or edit password-protected spreadsheets unless you remove the password first.
Pivot Table Interactivity: While Hatz can create a summary table that looks like a pivot table (calculated data), it generally does not create a native "Live Pivot Table" object that you can drag and drop fields within inside Excel. It creates the result of the pivot.
Formula Recalculation is Opt-In: Formula recalculation must be requested explicitly. Formulas are not automatically recalculated.
Calculation Engine: Formula behavior may differ slightly from Excel in edge cases, as recalculation is performed using a LibreOffice-backed engine.
Best Practices for Document Editing
Be Specific and Explicit
Provide exact references: Specify which sections, slides, sheets, or pages to modify (e.g., "slide 3," "column A," "paragraphs about pricing").
Clarify what to preserve: Tell Hatz what formatting or structure must remain unchanged (e.g., "keep formatting," "don't change layout," "maintain column order").
Set output expectations: Specify file names, formats, and any summaries you want (e.g., "export as XLSX," "name the file Report_Final.docx").
For Forms and Structured Data
Use clear field mappings: "Field Name = Value"
Provide values in a list or simple table format
Specify which checkboxes should be checked
Confirm Viewer Expectations
PDF appearance can vary across viewers. If exact visual fidelity matters, specify your target viewer (e.g., "Validate this works in Adobe Acrobat Reader").
Understand the Output Model
Hatz creates new files; it does not edit in place.
Original files remain unchanged.
Each request generates a fresh output file.
Troubleshooting Common Issues
"Tools unavailable" or "Code execution environment unavailable"
What this means: The code execution environment is temporarily unavailable.
What to do:
Retry your request once.
If the error persists, contact Support—there may be a platform issue.
PDF form values not visible after filling
What this means: Some PDF viewers don't render filled form values correctly without appearance regeneration.
What to do:
Open the PDF in Adobe Acrobat Reader (most reliable).
Try a different PDF viewer.
The system attempts appearance regeneration automatically, but viewer behavior varies.
PowerPoint text is cut off or overflows shapes
What this means: Replacement text is too long for the existing text box or shape.
What to do:
Request shorter copy.
Ask for layout adjustments ("expand the text box on slide 2").
Specify character or word limits in your request.
Excel formulas not updating
What this means: Formulas are not recalculated automatically.
What to do:
Explicitly request "recalculate all formulas" in your prompt.
Confirm which formulas should be updated if only certain sheets need recalculation.
OCR results are inaccurate
What this means: The scanned PDF has poor image quality or complex formatting.
What to do:
Use a higher-quality scan if possible.
Understand that OCR is best-effort and may not be 100% accurate.
Manually review extracted text for critical content.
