web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id : +LI9m0BOlB1wSmV9lKfA8c
Power Automate - Using Connectors
Answered

Error: Convert file to PDF

Like (1) ShareShare
ReportReport
Posted on 17 May 2023 03:51:06 by 32

I am getting this error and have tried as many provided work arounds in other similar chats as I can, but none of them are working. I've recreated the flow from the start with no change, and have tried convert from path as well - still errors. Please let me know if you can see anything that will help - the flow is taking responses from MS Form, putting them into a Word template with quickparts, saving then converting to PDF and emailing to the responder. I have been using this flow for years with occasional kinks when something in PowerAutomate updates/changes, but am at a loss for how to fix.

This is where I get the below error:

Nikola2_1-1684295421872.png

INPUTS
{
    "host": {
        "connectionReferenceName""shared_onedriveforbusiness",
        "operationId""ConvertFileByPath"
    },
    "parameters": {
        "path""/2022 Educator Capability Days/2023 May 31/testingtestingBringing Industry to the Training Environment.docx",
        "type""PDF"
    }
}

 

OUTPUTS

{
    "statusCode"415,
    "headers": {
        "Pragma""no-cache",
        "Transfer-Encoding""chunked",
        "x-ms-request-id""bc5a49b1-d240-49e1-a0d5-e8b85bc26cbc",
        "Timing-Allow-Origin""*",
        "x-ms-apihub-cached-response""true",
        "x-ms-apihub-obo""false",
        "Cache-Control""no-cache",
        "Date""Wed, 17 May 2023 02:25:07 GMT",
        "X-AspNet-Version""4.0.30319",
        "X-Powered-By""ASP.NET",
        "Content-Type""application/json",
        "Expires""-1",
        "Content-Length""717"
    },
    "body": {
        "status"415,
        "message""Error from Office Service. Url=https://wordcs.officeapps.live.com/document/export/pdf HttpCode=UnsupportedMediaType cert=subject:;thumbprint: ResponseHeaders=X-ErrorCode: WordDocumentHasMetroTemplateContentNonMetroTemplateExtension\r\nX-ClientCorrelationId: bc5a49b1-d240-49e1-a0d5-e8b85bc26cbc\r\nX-ServiceCorrelationId: bc5a49b1-d240-49e1-a0d5-e8b85bc26cbc\r\nX-ErrorCategory: NotSupported\r\nX-IsRetriable: False\r\nX-ConversionTimeInMs: 125.0045\r\nX-FileDownloadTimeInMs: 781.2629\r\nCache-Control: private\r\nDate: Wed, 17 May 2023 02:25:07 GMT\r\nServer: Microsoft-IIS/10.0\r\nX-AspNet-Version: 4.0.30319\r\nX-Powered-By: ASP.NET\r\n",
        "source""api.connectorp.svc.ms"
    }
}
I have the same question (0)
  • VIDIT Profile Picture
    666 on 17 May 2023 at 09:11:21
    Re: Error: Convert file to PDF

    Hey @Nikola2

    I think there is no need to do explicitly use the convert step, as you are already using a populate word document action. 
    See my flow below in which I am doing a similar thing I am just saving it in a SharePoint folder.

    ViditGholam_1-1684314372622.png

     

    in your case it will be like this

    ViditGholam_2-1684314545972.png

    this will automatically convert the word to PDF if this is not working you can get the document body convert it from Binary to base 64 string and use it in the content that will 100% convert your file to PDF

    Hope this helps! 

     

    I have solved your problem, please give me a thumbs up and mark this as solved.

     

  • VIDIT Profile Picture
    666 on 17 May 2023 at 09:47:45
    Re: Error: Convert file to PDF

    Hi @Nikola2 , 

     

    The above solution doesn't work I tried it myself on my flow it generates the document but the document gives errors.

    Instead of using file path in your convert PDF stage try using file ID see the screenshot below and blog link for
    reference

    ViditGholam_0-1684316834068.png

    Blog link - https://meganvwalker.com/generating-invoices-to-display-in-dynamics-365-portal/ 

    Hope this helps! 

     

    I have solved your problem, please give me a thumbs up and mark this as solved.

  • Nikola2 Profile Picture
    32 on 17 May 2023 at 22:33:37
    Re: Error: Convert file to PDF

    Hi @ViditGholam thanks for the advice.

    I did try removing the OneDrive convert actions and you're right, it wouldn't open the PDF due to errors. I then tried changing the convert file path to using ID rather than path as suggested, still didn't work but I got a different error to last time:

     

    The file conversion is of .docx to .pdf so unsure why, any advice?

    Nikola2_1-1684362728143.png

     

    Create File 2 - RAW Outputs:

    {
        "statusCode"200,
        "headers": {
            "Pragma""no-cache",
            "Range""bytes=0-1795357",
            "x-ms-request-id""c1cad07a-67c9-4cb7-9b58-1e8eb2e1c870",
            "Timing-Allow-Origin""*",
            "x-ms-apihub-cached-response""true",
            "x-ms-apihub-obo""false",
            "Cache-Control""no-cache",
            "Date""Wed, 17 May 2023 22:30:06 GMT",
            "X-AspNet-Version""4.0.30319",
            "X-Powered-By""ASP.NET",
            "Content-Type""application/json",
            "Expires""-1",
            "Content-Length""703"
        },
        "body": {
            "Id""b!sjBdm6WsWk24wDDjhYw7961MLcN0HLhCtcc7A4kmzmKPeOs_CeX5Sp9hjcOTRyqk.01RK2CAMJ2TZ67KJ65YFGYJ4ICNSY35ABC",
            "Name""a4trhaerh4truhrtNew Approaches to Old Problems",
            "NameNoExt""a4trhaerh4truhrtNew Approaches to Old Problems",
            "DisplayName""a4trhaerh4truhrtNew Approaches to Old Problems",
            "Path""/2022 Educator Capability Days/2023 May 31/a4trhaerh4truhrtNew Approaches to Old Problems",
            "LastModified""2023-05-17T22:30:06Z",
            "Size"1795358,
            "MediaType""application/octet-stream",
            "IsFolder"false,
            "ETag""\"{F57D9E3A-DD27-4DC1-84F1-026CB1BE8022},3\"",
            "FileLocator""b!sjBdm6WsWk24wDDjhYw7961MLcN0HLhCtcc7A4kmzmKPeOs_CeX5Sp9hjcOTRyqk.01RK2CAMJ2TZ67KJ65YFGYJ4ICNSY35ABC",
            "LastModifiedBy""Colls, Nikola"
        }
    }


    Convert File - RAW Inputs:

    {
        "host": {
            "connectionReferenceName""shared_onedriveforbusiness",
            "operationId""ConvertFile"
        },
        "parameters": {
            "id""b!sjBdm6WsWk24wDDjhYw7961MLcN0HLhCtcc7A4kmzmKPeOs_CeX5Sp9hjcOTRyqk.01RK2CAMJ2TZ67KJ65YFGYJ4ICNSY35ABC",
            "type""PDF"
        }
    }
     
    Convert File - RAW Outputs:
    {
        "statusCode"406,
        "headers": {
            "Pragma""no-cache",
            "Transfer-Encoding""chunked",
            "x-ms-request-id""c3c39851-80ce-4365-a76f-f0a991ada154",
            "Timing-Allow-Origin""*",
            "x-ms-apihub-cached-response""true",
            "x-ms-apihub-obo""false",
            "Cache-Control""no-cache",
            "Date""Wed, 17 May 2023 22:30:07 GMT",
            "X-AspNet-Version""4.0.30319",
            "X-Powered-By""ASP.NET",
            "Content-Type""application/json",
            "Expires""-1",
            "Content-Length""165"
        },
        "body": {
            "status"406,
            "message""Conversion of this file to PDF is not supported. (InputFormatNotSupported / Bad request)",
            "source""api.connectorp.svc.ms"
        }
    }
     
    Cheers, Nikola
  • VIDIT Profile Picture
    666 on 18 May 2023 at 04:03:23
    Re: Error: Convert file to PDF

    Hi @Nikola2,

    I think you are doing it incorrectly; the error says input format is not support. can you the screenshots of your entire flow?

     

  • Nikola2 Profile Picture
    32 on 18 May 2023 at 04:15:40
    Re: Error: Convert file to PDF

    Hi @ViditGholam , sure thing here are all the images. I've been using this flow successfully for 3 years now haha. Very frustrating when I have to create a new one for a new form/event and this happens!

     

    Nikola2_0-1684383272535.png

    Nikola2_1-1684383288027.png

     

    Nikola2_2-1684383316141.png

     

    Nikola2_3-1684383335706.png

    Nikola2_4-1684383352063.png

     

     

  • Verified answer
    VIDIT Profile Picture
    666 on 18 May 2023 at 05:15:20
    Re: Error: Convert file to PDF

    Hi @Nikola2 , 

     

    I think you need to pass document type here it should ne {Name}.docx

    ViditGholam_0-1684386911636.png

     

  • Nikola2 Profile Picture
    32 on 18 May 2023 at 05:23:00
    Re: Error: Convert file to PDF

    Thanks so much @ViditGholam , that worked and everything ran properly - I feel a bit silly now as I should have tried that in troubleshooting!
    Cheers 🙂

  • VIDIT Profile Picture
    666 on 18 May 2023 at 05:28:48
    Re: Error: Convert file to PDF

    Hi @Nikola2 

     

    Happy to help!

    One more tip instead of creating a file in SharePoint first and then updating it you can just create a word template. and then use populate word document and save it directly to one drive and then convert it, this currently flow will bloat your storage as you are storing the same file twice.

  • Nikola2 Profile Picture
    32 on 18 May 2023 at 05:44:07
    Re: Error: Convert file to PDF

    Thanks @ViditGholam , great point I'll look into that! 

    Cheers 🙂

  • Mikee7891 Profile Picture
    Microsoft Employee on 04 Mar 2024 at 22:50:57
    Re: Error: Convert file to PDF

    I'm trying to build a simple flow that automatically converts a docx file saved in a folder in my Onedrive into a PDF and save it in a Sharepoint location, but I keep getting an error message at the conversion step. 

     

    Error from Office Service. Url=https://wordcs.officeapps.live.com/document/export/pdf HttpCode=NotFound cert=subject:;thumbprint: ResponseHeaders=Connection: close
    Date: Mon, 04 Mar 2024 22:49:12 GMT
    Server: Microsoft-IIS/10.0
    X-Powered-By: ASP.NET

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 655 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 371 Moderator

#3
chiaraalina Profile Picture

chiaraalina 276

Last 30 days Overall leaderboard

Featured topics