Skip to main content

Fix "File is Empty" or "File could not be opened"

If you see one of these error messages when calling PDF4me—from the API, Power Automate, Zapier, Make, or n8n—it usually means the file we received is either empty, corrupted, or in a format we can't process.


Error Messages You Might See

File is Empty
File could not be opened
Document is Empty
Invalid File
Unable to read file

Quick Resolution Checklist

  1. Verify the file – Opens locally, not 0 bytes
  2. Check Base64 – Not truncated, correctly encoded (Power Automate, Zapier, Make, n8n)
  3. Confirm upstream steps – All flow steps before PDF4me succeeded
  4. Use correct file type – PDF for ExtractTextByExpression, SplitPdfByBarcode; convert images first if needed

Resolution Steps

Step 1: Verify the file on your side
  • Open the file locally and confirm it opens without errors
  • Check the file size—it should not be 0 bytes
  • If it's a PDF, try opening it in a standard PDF viewer
Step 2: Check Base64 encoding (Power Automate, Zapier, Make, n8n)
  • Ensure the Base64 encoding step runs correctly and isn't truncated
  • If using dynamic content, confirm the content is not empty
  • Test with a known-good file to isolate the issue
Step 3: Confirm upstream steps succeeded
  • In Power Automate, review the run history
  • In Zapier, check that the trigger and preceding steps returned expected output
  • If an earlier step fails or returns null, the file passed to PDF4me may be empty
Step 4: Use the correct file type
  • ExtractTextByExpression, SplitPdfByBarcode, Parse Document: send PDF only
  • ImageStamp: main document is typically PDF; stamp image can be an image format
  • When in doubt, convert to PDF first with Convert to PDF

Platform-Specific Tips

Zapier: "File: (Exists but not shown)"

When using Zapier, if you see "File is Empty" or "File could not be opened", check whether "File: (Exists but not shown)" is selected. Zapier may pass a reference instead of the actual file content. Switch to the option that provides the full file (e.g. actual file content or Base64), not the "Exists but not shown" placeholder.

Power Automate and Base64

PDF4me actions usually accept Base64-encoded file content. Make sure the expression or dynamic content returns the full Base64 string, you're not passing a file path or URL where Base64 is expected, and the "File Content" field receives the output of a proper Base64 conversion step.

Make and n8n

The same principles apply: use full file content or Base64, ensure upstream modules completed successfully, and use PDF for actions that require PDF input.


Common Causes (expand for details)

Details

File didn't upload or download completely The file may have been interrupted during transfer. If you're fetching from a URL, the connection could have dropped before the full file arrived.

Details

Base64 encoding is wrong or truncated When sending files as Base64 (common in Power Automate and Zapier), the string can be cut off if the output is limited by character length, incorrectly encoded, or missing if the previous step failed.

Details

Wrong file type for the action Some PDF4me actions expect PDF only. Sending an image (JPG, PNG, etc.) to ExtractTextByExpression or SplitPdfByBarcode will cause "File could not be opened" or "Invalid File". Convert images to PDF first using Convert to PDF.

Details

File is zero bytes or partially generated An upstream step in your flow may have failed, returned no output, or the source file was never fully created.

Details

URL returns HTML instead of the actual file The link may have expired, been blocked, require authentication we can't provide, or return an HTML error page instead of the document.

Details

Unsupported content or formatting The document may contain content or structure that our processing engine can't handle. Less common but possible with heavily modified or non-standard PDFs.