We're sorry GroupDocs doesn't work properply without JavaScript enabled.

Free Support Forum - groupdocs.com

Word to PDF conversion exception on debian/Linux 10 with .net core 5

Hi,
I try to convert docx to pdf but it just creates pdf file with 0kb size and it throws an exception.
On windows while developing it works fine. But deployed on the linux server it didn’t work.
I tried to use Converter() with the filePath, and also with a Stream, but always the same problem.

Exception:
GroupDocs.Conversion.Exceptions.GroupDocsConversionException: Object reference not set to an instance of an object.
at GroupDocs.Conversion.Converter.Convert(SaveDocumentStreamForFileType document, ConvertedDocumentStream documentCompleted, ConvertOptionsProvider convertOptionsProvider)
at GroupDocs.Conversion.Converter.Convert(SaveDocumentStream document, ConvertedDocumentStream documentCompleted, ConvertOptionsProvider convertOptionsProvider)
at GroupDocs.Conversion.Converter.Convert(SaveDocumentStream document, ConvertOptions convertOptions)
at f2p_api.Actions.Convert.ConvertToPdf(Int32 id, String path, String inputFileName, String outputFileName) in /home/vsts/work/1/s/File2PDF/f2p-api/Actions/Convert.cs:line 55

Dependencies:
-GroupDocs.Conversion(21.10.0)
-SkiaSharp.NativeAssets.Linux.NoDependencies (2.80.3)

System:
-Debian GNU/Linux 10

the code is running on

  • .net core 5

Code:
sampleCode.docx (14.8 KB)

1 Like

@MartinOstendis

Could you please share the problematic Word file? We’ll then look into this issue? Do you get this exception for all the Word files (or with a particular one)?

@Atir_Tahir

I have the same exception for every docx file.
for example: myDoc.docx (11.7 KB)

In addition, I tried other file types and received different exceptions:
A simple xlsx file:

GroupDocs.Conversion.Exceptions.GroupDocsConversionException: The type initializer for ’ threw an exception.
at GroupDocs.Conversion.Converter.Convert(SaveDocumentStreamForFileType document, ConvertedDocumentStream documentCompleted, ConvertOptionsProvider convertOptionsProvider)
at GroupDocs.Conversion.Converter.Convert(SaveDocumentStream document, ConvertedDocumentStream documentCompleted, ConvertOptionsProvider convertOptionsProvider)
at GroupDocs.Conversion.Converter.Convert(SaveDocumentStream document, ConvertOptions convertOptions)
at f2p_api.Actions.Convert.ConvertToPdf(Int32 id, String path, String inputFileName, String outputFileName) in /home/vsts/work/1/s/File2PDF/f2p-api/Actions/Convert.cs:line 55

For a png file: myPng.png (12.0 KB)
Exception:
GroupDocs.Conversion.Exceptions.CorruptOrDamagedFileException: Cannot convert. The file is corrupt or damaged.
at GroupDocs.Conversion.Converter.Convert(SaveDocumentStreamForFileType document, ConvertedDocumentStream documentCompleted, ConvertOptionsProvider convertOptionsProvider)
at GroupDocs.Conversion.Converter.Convert(SaveDocumentStream document, ConvertedDocumentStream documentCompleted, ConvertOptionsProvider convertOptionsProvider)
at GroupDocs.Conversion.Converter.Convert(SaveDocumentStream document, ConvertOptions convertOptions)
at f2p_api.Actions.Convert.ConvertToPdf(Int32 id, String path, String inputFileName, String outputFileName) in /home/vsts/work/1/s/File2PDF/f2p-api/Actions/Convert.cs:line 55

All 3 files converted well while developing on visual studio on my windows machine. Also the png is not corrupted or damaged. But deployed on the linux server it throws these exceptions.

1 Like

@MartinOstendis

We’re investigating this issue at our end. Your investigation ticket ID is CONVERSIONNET-4977. You’ll be notified in case of any update.