Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Mon Sep 30, 2019 3:21 am

Recently we decided to move our documents to Azure blob, Wondering how can I convert the word document in Azure blob to pdf and save using .Net Core.

Till it works as we are using file storage.

Could you please share an sample to achieve it.

Please let me know should have any questions/comments. Thank you.

portal.support@minterellison.co.nz
 
Posts: 8
Joined: Mon Feb 25, 2019 8:13 pm

Mon Sep 30, 2019 7:18 am

Hi,

Thanks for your inquiry.
Spire.Doc supports to load the Word file via file path or file stream and save it to Pdf file or Pdf stream. You could get the file stream first from Azure blob, then save to Pdf stream and update on Azure blob. Below is the code of Spire for your reference.

Code: Select all
            Document doc = new Document();

            //Load file via stream
            doc.LoadFromStream(fileStream, Spire.Doc.FileFormat.Docx);

            //Save it to Pdf stream
            MemoryStream pdfStream = new MemoryStream();
            doc.SaveToStream(pdfStream, Spire.Doc.FileFormat.PDF);


Best wishes,
Amber
E-iceblue support team
User avatar

Amber.Gu
 
Posts: 525
Joined: Tue Jun 04, 2019 3:16 am

Return to Spire.Doc