This .NET 6 Background Service Worker is designed to convert bulk Word documents to PDFs using LibreOffice 7. The service runs in the background, monitoring a specified directory for incoming Word documents and automatically converting them to PDF format.
-
.NET 6 SDK: Ensure you have the .NET 6 SDK installed on your machine. You can download it here.
-
LibreOffice 7: Install LibreOffice 7 on your system. You can download it here.
- Open the appsettings.json file.
- Update the LibreOfficePath setting with the path to your LibreOffice 7 installation.
- If soffice is globally enabled, set IsGlobal to true
"LibreOfficeConfig": {
"IsGlobal": false,
"Path": "C:\\Program Files\\LibreOffice\\program\\soffice.exe"
},
- Open the appsettings.json file.
- Update the DocFilesPath setting with the path to the directory where Word documents will be placed for conversion.
- Update the DocFilesPath setting with the path to the directory where PDF documents will be stored.
"DocumentConversionConfig": {
"DocFilesPath": "C:\\DocConv\\docx",
"PdfFilesPath": "C:\\DocConv\\pdf"
}
dotnet restore
dotnet build
dotnet run