1
File conversion from Docx to pdf throws error
Problem reported by Libin Emmanuel - 5/16/2023 at 3:00 AM
Resolved
Hi,
I am trying to convert a docs file to pdf from my c# project using the DocumentUltimate dll having version
6.4.5.0. Also Common dll version is 5.5.0.0. The error throws is below:
Could not detect document format for the output file because there is no extension in file name and an output format is not specified.

Please do let me know the fix for this.

Regards,
Libin

1 Reply

Reply to Thread
0
Cem Alacayir Replied
Employee Post Marked As Resolution
The error already tells it, you either provide a output file extension or output format:

// Convert "c:\SomeFolder\InputFile.docx" to "c:\SomeFolder\InputFile.pdf"
DocumentConverter.Convert(@"c:\SomeFolder\InputFile.docx", DocumentFormat.Pdf);

// Convert "c:\SomeFolder\InputFile.docx" to "c:\SomeFolder\OutputFile.pdf"
DocumentConverter.Convert(@"c:\SomeFolder\InputFile.docx", @"c:\SomeFolder\OutputFile.pdf");


Reply to Thread