Skip to content

PDF generation (-p flag) fails silently on Windows even with LibreOffice installed #2444

@Adarshkumar0509

Description

@Adarshkumar0509

Describe the bug
PDF generation using the -p flag fails silently on Windows even when LibreOffice is installed. The converter detects LibreOffice at C:\Program Files\LibreOffice\program\soffice.exe but then flags it as "potentially dangerous" due to the space in the path, blocking PDF conversion entirely. The error message incorrectly tells users to "install LibreOffice" even though it is already installed.

To Reproduce

  1. Install LibreOffice on Windows
  2. Clone the repository
  3. Run: python scripts/convert.py -lt guide -l en -v 2.2 -p
  4. Observe WARNING messages and no PDF is generated

Expected behavior
A PDF file should be generated in the output folder when the -p flag is used with LibreOffice installed.

Screenshots

Image

Desktop (please complete the following information):

  • OS: Windows 11 (Version 25H2, Build 26200.7922)
  • Browser: N/A
  • Python: 3.13.9
  • Version: v2.2-EN
  • LibreOffice: installed at C:\Program Files\LibreOffice

Smartphone:

  • N/A

Additional context
The root cause appears to be in _validate_command_args which flags the space in "C:\Program Files" as a potentially dangerous character, blocking the PDF conversion on Windows. The exact warnings are:

WARNING | _validate_command_args | Potentially dangerous character found in argument: C:\Program Files\LibreOffice\program\soffice.exe
WARNING | _handle_conversion_failure | Error. Cannot be converted to pdf on operating system: Windows. Please install LibreOffice for cross-platform PDF support.

No PDF file is created — confirmed by: dir output*.pdf → File Not Found

Are you going to work on fixing this?

  • Yes
  • No

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions