...

Guides for PDF library

How to use Flyingbee PDF Conversion SDK.


Want to Try?

Try Flyingbee PDF Converter Online for Free, play with PDF to MS Office (.docx, .xlsx, .pptx) conversion on Web.

Launch Web Demo

Powered by Flyingbee PDF Conversion SDK

5.0 pdf-converter.sh


james wei 2025-09-19 11:55:16
This command can convert all PDF files under the folder into Word files. You can customize and modify the source folder and output format
 
$ cd "/home/your-name/script-folder/"
$ ls # Is there pdf-converter.sh file in current directory
pdf-converter.sh
$ chmod +x pdf-converter.sh  # ✅ Granting executable permissions
$ ./pdf-converter.sh   # 🔄 execute command
Example Output
🗑️  Cleaning up all .docx files...
✅  All .docx files have been removed.
📦  Found 3 PDF file(s), starting conversion...
>>>>>>>>>>>>>>>>>>>>
🔄  Converting (1/3): report_a.pdf
>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>
🔄  Converting (2/3): summary.pdf
>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>
🔄  Converting (3/3): final.pdf
>>>>>>>>>>>>>>>>>>>>
🎉  All conversions completed! Processed 3 file(s).

By following these steps, you should be able to successfully deploy and run the Flyingbee PDF Converter SDK. If you encounter any issues, carefully check the error messages and make adjustments or install missing dependencies as needed.

📦 Attachment:

Copy to Notepad and save as "pdf-converter.sh"

# ============ Bash Script: Convert All PDFs to DOCX/PPTX/XLSX/HTML/CSV/TXT, etc.. ============
#!/bin/bash

# ============ Configuration Section (Please modify according to your setup) ============
PDF_DIR="./"                                   # Directory containing PDF files, "./" means current directory
TOOL_PATH="/home/your-name/sdk-folder/FPPDFConverter.out"
OUTPUT_FORMAT="docx"                           # Output format (can be changed to pptx, xlsx, html, csv, txt, etc.)
# ======================================================================================

# Enter the PDF directory
cd "$PDF_DIR" || { echo "❌ Failed to enter directory: $PDF_DIR"; exit 1; }

# Remove all existing output format files
echo "🗑️  Cleaning up all .$OUTPUT_FORMAT files..."
rm -f *."$OUTPUT_FORMAT"
echo "✅  All .$OUTPUT_FORMAT files have been removed."

# Gather all PDF files into an array
pdf_files=(*.pdf)

# Check if any PDF file exists
if [[ ! -f "${pdf_files[0]}" ]]; then
    echo "⚠️  No PDF files found in the directory."
    exit 0
fi

# Count total number of PDFs
total=${#pdf_files[@]}
echo "📦  Found $total PDF file(s), starting conversion..."

# Loop through each PDF and convert
for i in "${!pdf_files[@]}"; do
    pdf_file="${pdf_files[$i]}"
    index=$((i + 1))

    echo ">>>>>>>>>>>>>>>>>>>>"
    echo "🔄  Converting file($index/$total): $pdf_file"
    echo ">>>>>>>>>>>>>>>>>>>>"

    # Execute the conversion command
    "$TOOL_PATH" -a PDF2Files -i "$pdf_file" -f "$OUTPUT_FORMAT" -p all
done

echo "🎉  All conversions completed! Processed $total file(s)."



4. Quick Start Guide
No More...

Apple, the Apple logos, MacBook, iPad, iPhone, Apple Watch, and Apple Vision Pro are trademarks of Apple Inc., registered in the U.S. and other countries. App Store and Mac App Store is a service mark of Apple Inc., registered in the U.S. and other countries.
© 2014 - 2025 Flyingbee Software, All Right Reserved.
United StatesUnited States

We uses cookies to give you the best experience, analyze traffic, and personalize content. By continuing using our Site, you agree to our use of cookies. The information collected might relate to you, your preferences, or your device, and is mostly used to make the site work as you expect it to and to provide a more personalized web experience. However, you can choose not to allow certain types of cookies, which may impact your experience of the site and the services we are able to offer. Read our Privacy Policy or manage your cookie preferences. If you would like to submit an opt-out request with respect to your non-cookie personal information (e.g., your email address), find our support email address to opt-out of sale/sharing/targeting with respect to non-cookie personal information.