Convert .doc to pdf

0
danvonfeldt posted this 09 March 2018

I'm looking to convert a ".doc" to pdf, but am receiving "Cannot infer input format from the file extension '.doc'. The file path should have an extension of the one of the supported file formats." I'm wondering if ".doc" is supported?

The code I am using:

        Document doc = Document.Load(inputFilePath);
        using (var ms =new MemoryStream())
        {
            doc.Save(ms, Docentric.Documents.ObjectModel.SaveOptions.Pdf);
            return ConvertHelper.ConvertStreamToByteArray(ms);
        }

29 Posts
29 Points
3 Comments
Order By: Standard | Newest | Votes
1
jles posted this 10 March 2018

Hi Dan,

No, the old MS Word binary format is not supported. You will need an external means to format .doc document to .docx first.

Regards,

Jure

155 Posts
295 Points
0
danvonfeldt posted this 19 November 2018

Hi, I wanted to add an additional item on to this one. We are having some issues with .doc's that have been converted to .docx, but are receiving an error when the docx is attempted to be saved as pdf.

I have attached the file that was a .doc that has been converted to a .docx via MS Word.

I am receiving an Object Reference Error with the following stack trace: at #=zKWmW1eAtwomU$ZAYmAup7whiPXQqACRbWoziKMdKHmh0kGMwf7I84s=.#=zW0gTEimRY5MnygxNVA==(TextInput #=z9eadssS9bT$N) at #=zKWmW1eAtwomU$ZAYmAup7whiPXQqACRbWoziKMdKHmh0kGMwf7I84s=.#=z5OY6xftkE2HxgPXOQ==() at #=zKWmW1eAtwomU$ZAYmAup7whiPXQqACRbWoziKMdKHmh0kGMwf7I84s=.#=zHSBMY8=() at #=zeLDs8dPK44qezxu5cQ5MtbIuCTQtsazDr61tMVUqTHt67pTUsA==.#=zKy0ZZIQ=() at #=zJBoz190WZVAaIXOf4tfApESqUHG3oXhiyxmmCXVxUyXi7O70948ezis=.#=z$1tFTanMYmpT(Story #=zvPkVaKfGJ$8Z, #=zmPvyQNgZbt344ZVu8rHV7IHSJl4x$QOqLAQcqsBi33vM #=zbgGvaLA=, Dictionary2 #=zGI545Ix41u4xZGG7wzNTTXs=, #=zAD7HujfBkSP$oH7pqBW5Qbs9krQq5eFIVyL$cru6CmGZdIOlVA== #=zKlqMt5kVoQth) at #=zJBoz190WZVAaIXOf4tfApESqUHG3oXhiyxmmCXVxUyXi7O70948ezis=.#=zNbJ9AJU=() at Docentric.Documents.ObjectModel.Document.#=z9Fd1L$NCj0TF(#=zujpNMZPxsiGjAod_AYe2MIKQWdL$PFiJ4Q== #=zfpQp3t8=, #=z62AbdtR2rpyg9AM$LTJXJXROJxDTd3m3O2JBv13xT8Fk& #=zrW_AQiQdK8PT, Dictionary2& #=zs0BtrH3pDLVAHZN$$rFipC4=) at Docentric.Documents.ObjectModel.Document.#=zFN5fFdk=(Stream #=zij6HGRk=, SaveOptions #=zQ96s7daYnWPa, #=zkPYC5ywKNhIvZd0OWIb8CVTf$WCwrr3Ntt9R9B4jK1oEAgPMg== #=zxd00EFFfSCx6) at Docentric.Documents.ObjectModel.Document.Save(Stream stream, SaveOptions saveOptions) at CROPP.Services.Common.Utilities.MicrosoftWordHelper.ConvertToPdf(String inputFilePath) in C:\source\CROPP\CROPP.Services\Common\Utilities\MicrosoftWordHelper.cs:line 116

29 Posts
29 Points
0
jles posted this 09 January 2019

Hi Dan,

This issue has been fixed and will be available with the next v6.0 RC version. Please let us know if you would like to be notified when the new release will ready.

Best regards,

Jure Leskovec

155 Posts
295 Points

Our 229039 members have posted 345 times in 102 discussions