diff --git a/ocrmypdf/pipeline.py b/ocrmypdf/pipeline.py
index <HASH>..<HASH> 100644
--- a/ocrmypdf/pipeline.py
+++ b/ocrmypdf/pipeline.py
@@ -806,6 +806,7 @@ def copy_final(
         from shutil import copyfileobj
         with open(input_file, 'rb') as input_stream:
             copyfileobj(input_stream, sys.stdout.buffer)
+            sys.stdout.flush()
     else:
         shutil.copy(input_file, output_file)
Output to stdout: ensure stdout is flushed to prevent truncation errors