{"id":1111,"date":"2019-06-05T10:00:31","date_gmt":"2019-06-05T17:00:31","guid":{"rendered":"https:\/\/cm-edgetun.pages.dev\/en-us\/power-platform\/blog\/power-automate\/intermediate-flow-of-the-week-how-to-automate-pdf-document-generation-from-a-docx-template-using-microsoft-flow\/"},"modified":"2025-06-11T08:03:45","modified_gmt":"2025-06-11T15:03:45","slug":"intermediate-flow-of-the-week-how-to-automate-pdf-document-generation-from-a-docx-template-using-microsoft-flow","status":"publish","type":"post","link":"https:\/\/cm-edgetun.pages.dev\/en-us\/power-platform\/blog\/power-automate\/intermediate-flow-of-the-week-how-to-automate-pdf-document-generation-from-a-docx-template-using-microsoft-flow\/","title":{"rendered":"Intermediate | Flow of The Week: How to automate PDF document generation from a DOCX template using Microsoft Flow"},"content":{"rendered":"<p><strong>How to automate PDF documents generation from a DOCX template using Microsoft Flow<\/strong><\/p>\n<p>Written by Anton Khritonenkov.<\/p>\n<div><span class=\"markizbccc5df\" data-markjs=\"true\" data-ogab=\"\" data-ogac=\"\" data-ogsb=\"\" data-ogsc=\"\">Anton<\/span>\u00a0 is a co-founder of Plumsail ([https:\/\/plumsail.com)]https:\/\/plumsail.com), SharePoint and Office 365 expert. He is passionate about design and development of easy to use, convenient and flexible products. You can follow him on Twitter at\u00a0<a data-auth=\"Verified\" href=\"https:\/\/nam06.safelinks.protection.outlook.com\/?url=https%3A%2F%2Ftwitter.com%2Fantonkhrit&amp;data=02%7C01%7Cjolevesq%40microsoft.com%7C76ace8d048f945b35cb208d6c70e9e47%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636915263708942496&amp;sdata=8c6ss2uHzqT5IXDt3k8eF2ulEiDpgNe1bAFSfwkoUK0%3D&amp;reserved=0\" rel=\"noopener noreferrer\" target=\"_blank\" title=\"Original URL: https:\/\/twitter.com\/antonkhrit. Click or tap if you trust this link.\">@antonkhrit<\/a><\/div>\n<div><\/div>\n<p>\u00a0<\/p>\n<p>In this article, I will describe how to automate the creation of complex PDF documents from a template. Let us say we have a sales department. They are tired of filling the same documents with brief changes again and again. We could provide them some form for filling data and generate documents automatically.<\/p>\n<p>Microsoft Flow is a glue between different services. It makes it possible to pick a few products that suite your needs and use them together without writing a line of code.<\/p>\n<p>In this article, I will show how to use SharePoint Online, <a href=\"https:\/\/plumsail.com\/forms\/\">Plumsail Forms<\/a>, and <a href=\"https:\/\/plumsail.com\/documents\/\">Plumsail Documents<\/a> together for satisfying our requirements for the invoicing process.<\/p>\n<p>We will need to create a form, then trigger a flow on form submission, generate an invoice from a template. Then we will save the generated invoice in the SharePoint document library of our sales department. Then the document will be sent by email to a customer.<\/p>\n<p><strong>Create an invoice\u00a0form<\/strong><\/p>\n<p>In this article, I used Plumsail Forms for Web, but you can use any other forms solution that has integration with Microsoft Flow and supports tables.<\/p>\n<p>I designed the form as a wizard to simplify the user experience. Below you can see how it looks.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" class=\"alignnone size-full wp-image-1112\" height=\"664\" src=\"https:\/\/powerautomateblogmedia.azureedge.net\/powerautomateblog\/2019\/06\/1.gif\" width=\"768\"\/><\/p>\n<p>I will not describe here the implementation of the form. You can <a href=\"https:\/\/static.plumsail.com\/wp-content\/uploads\/Files\/PublicBlogs\/FlowOfficial\/AutomatePDF\/invoice-form.xfds\">download the export file<\/a> and <a href=\"https:\/\/plumsail.com\/docs\/forms-web\/designer\/ribbon-actions.html?highlight=export#export-and-import\">import it on your side<\/a>. You will get the same form.<\/p>\n<p><strong>Note:<\/strong> While creating your form assign meaningful internal names to the fields, table and table columns. Those internal fields will be a part of data sent to our Microsoft Flow.<\/p>\n<p>This is how you can specify the internal name:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" class=\"alignnone size-full wp-image-1113\" height=\"293\" src=\"https:\/\/powerautomateblogmedia.azureedge.net\/powerautomateblog\/2019\/06\/2.png\" width=\"800\"\/><br \/>\n<strong>Prepare DOCX template for\u00a0invoice<\/strong><\/p>\n<p>I want to use DOCX template instead of HTML or some other format because it gives more control to end user (our sales department). The person without programming skills has to be able to change the template and adjust the styling of the documents.<\/p>\n<p><a href=\"https:\/\/static.plumsail.com\/wp-content\/uploads\/Files\/PublicBlogs\/FlowOfficial\/AutomatePDF\/invoice-template.docx\">Click here<\/a> to download the sample template. This is how it looks:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" class=\"alignnone size-full wp-image-1114\" height=\"573\" src=\"https:\/\/powerautomateblogmedia.azureedge.net\/powerautomateblog\/2019\/06\/3.png\" width=\"645\"\/><\/p>\n<p>You can see that there are some tokens like {{data.bulletFullName}}. We will use data from our forms to replace them.<\/p>\n<p>A bit tricky part is a table with products. There is a single row with tokens like {{data.product.quantity}} in the Word table. The template will automatically understand that the \u201cproducts\u201d is an array and replicate rows for each product item.<\/p>\n<p>I would recommend you to read more about template syntax in <a href=\"https:\/\/plumsail.com\/docs\/documents\/v1.x\/document-generation\/docx\/index.html\">the documentation<\/a>.<\/p>\n<p>Later in the Flow, you will see the JSON object that is applied to the template. Understanding the structure of this object will help you to create the correct template.<\/p>\n<p>When the template is ready we can save it somewhere in SharePoint. Let us say we saved it in the document library of our sales department site.<\/p>\n<p><strong>Create Microsoft Flow for invoice generation<\/strong><\/p>\n<p>Now we need to create a Flow that will receive data from the form submission and apply it to the template that we prepared.<\/p>\n<p>Here is how our Flow looks:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" class=\"alignnone size-full wp-image-1115\" height=\"1641\" src=\"https:\/\/powerautomateblogmedia.azureedge.net\/powerautomateblog\/2019\/06\/4.png\" width=\"620\"\/><\/p>\n<p>Let us review it step by step.<\/p>\n<p><strong>Flow trigger<\/strong><\/p>\n<p>Flow is triggered when the form is submitted. You need to put form ID into the trigger to enable this. Review <a href=\"https:\/\/plumsail.com\/docs\/forms-web\/microsoft-flow.html\">this instruction<\/a> for more information.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" class=\"alignnone size-full wp-image-1116\" height=\"96\" src=\"https:\/\/powerautomateblogmedia.azureedge.net\/powerautomateblog\/2019\/06\/5.png\" width=\"600\"\/><br \/>\n<strong>Getting DOCX\u00a0template<\/strong><\/p>\n<p>We use \u201cGet file content\u201d action from SharePoint connector to get the DOCX template from the SharePoint document library where we saved it earlier.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" class=\"alignnone size-full wp-image-1117\" height=\"159\" src=\"https:\/\/powerautomateblogmedia.azureedge.net\/powerautomateblog\/2019\/06\/6.png\" width=\"600\"\/><br \/>\n<strong>Initialize invoice\u00a0number<\/strong><\/p>\n<p>We use the \u201cInitialize variable\u201d action to generate an invoice ID. Put this expression into the variable. It represents the current date formatted as \u201cyyMMdd\u201d. You can use any other approach for numbering. I just like this one.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" class=\"alignnone size-full wp-image-1118\" height=\"203\" src=\"https:\/\/powerautomateblogmedia.azureedge.net\/powerautomateblog\/2019\/06\/7.png\" width=\"800\"\/><br \/>\n<strong>formatDateTime(utcNow()<\/strong>, \u2018yyMMdd\u2019<strong>)<\/strong><br \/>\n<strong>Apply our DOCX\u00a0template<\/strong><\/p>\n<p>The action uses <a href=\"https:\/\/plumsail.com\/docs\/documents\/v1.x\/flow\/actions\/document-processing.html#create-docx-document-from-template\">Create DOCX document from template<\/a> action. You just put the DOCX template into \u201cDocument content\u201d property. Then specify the JSON object as on the picture below. The JSON object is applied to our DOCX template. There are two fields in this object:<\/p>\n<ol>\n<li>invoiceNumber\u200a\u2014\u200avariable from the previous step.<\/li>\n<li>data\u200a\u2014\u200adata from the Plumsail Forms trigger. The \u201cBody\u201d represents all data received from the form.<\/li>\n<li><img loading=\"lazy\" decoding=\"async\" alt=\"\" class=\"alignnone size-full wp-image-1119\" height=\"236\" src=\"https:\/\/powerautomateblogmedia.azureedge.net\/powerautomateblog\/2019\/06\/8.png\" width=\"600\" srcset=\"https:\/\/cm-edgetun.pages.dev\/en-us\/power-platform\/blog\/wp-content\/uploads\/2019\/06\/8.webp 600w, https:\/\/cm-edgetun.pages.dev\/en-us\/power-platform\/blog\/wp-content\/uploads\/2019\/06\/8-300x118.webp 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/li>\n<\/ol>\n<p><strong>Convert generated DOCX document to\u00a0PDF<\/strong><\/p>\n<p>You just need to put the output from the previous action to <a href=\"https:\/\/plumsail.com\/docs\/documents\/v1.x\/flow\/actions\/document-processing.html#convert-docx-to-pdf\">Convert DOCX to PDF<\/a> action:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" class=\"alignnone size-full wp-image-1120\" height=\"99\" src=\"https:\/\/powerautomateblogmedia.azureedge.net\/powerautomateblog\/2019\/06\/9.png\" width=\"600\" srcset=\"https:\/\/cm-edgetun.pages.dev\/en-us\/power-platform\/blog\/wp-content\/uploads\/2019\/06\/9.webp 600w, https:\/\/cm-edgetun.pages.dev\/en-us\/power-platform\/blog\/wp-content\/uploads\/2019\/06\/9-300x50.webp 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><br \/>\n<strong>Save result PDF into SharePoint and send\u00a0email<\/strong><\/p>\n<p>Then in the last to actions, we save the result PDF file in SharePoint for future reference and send it by email to our customer.<\/p>\n<p>The \u201cbilledEmail\u201d is taken from the form submission trigger.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" class=\"alignnone size-full wp-image-1121\" height=\"606\" src=\"https:\/\/powerautomateblogmedia.azureedge.net\/powerautomateblog\/2019\/06\/10.png\" width=\"600\" srcset=\"https:\/\/cm-edgetun.pages.dev\/en-us\/power-platform\/blog\/wp-content\/uploads\/2019\/06\/10.webp 600w, https:\/\/cm-edgetun.pages.dev\/en-us\/power-platform\/blog\/wp-content\/uploads\/2019\/06\/10-297x300.webp 297w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><br \/>\n<strong>Conclusion<\/strong><\/p>\n<p>Microsoft Flow allows us to automate a lot of things and integrate various services. One of the common cases is document management automation. I hope this article will help you to save your time and time of your colleagues. Spend time for more valuable tasks than filling out some papers again and again. I think it worth it to spend some time on automation and then delegate it to Microsoft Flow.<\/p>\n<p>Please leave comments and questions below and be sure to Follow Anton on Twitter!<\/p>\n<p>\u00a0<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this article, I will describe how to automate the creation of complex PDF documents from a template. Let us say we have a sales department. They are tired of filling the same documents with brief changes again and again. We could provide them some form for filling data and generate documents automatically.<\/p>\n","protected":false},"author":348,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ms_queue_id":[],"ep_exclude_from_search":false,"_classifai_error":"","_classifai_text_to_speech_error":"","_alt_title":"","ms-ems-related-posts":[],"footnotes":""},"audience":[3378],"content-type":[3423],"job-role":[],"product":[3474],"property":[],"topic":[],"coauthors":[2899],"class_list":["post-1111","post","type-post","status-publish","format-standard","hentry","audience-it-professional","content-type-tips-and-guides","product-power-automate"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Intermediate | Flow of The Week: How to automate PDF document generation from a DOCX template using Microsoft Flow - Microsoft Power Platform Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/cm-edgetun.pages.dev\/en-us\/power-platform\/blog\/2019\/06\/05\/intermediate-flow-of-the-week-how-to-automate-pdf-document-generation-from-a-docx-template-using-microsoft-flow\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Intermediate | Flow of The Week: How to automate PDF document generation from a DOCX template using Microsoft Flow - Microsoft Power Platform Blog\" \/>\n<meta property=\"og:description\" content=\"In this article, I will describe how to automate the creation of complex PDF documents from a template. Let us say we have a sales department. They are tired of filling the same documents with brief changes again and again. We could provide them some form for filling data and generate documents automatically.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/cm-edgetun.pages.dev\/en-us\/power-platform\/blog\/power-automate\/intermediate-flow-of-the-week-how-to-automate-pdf-document-generation-from-a-docx-template-using-microsoft-flow\/\" \/>\n<meta property=\"og:site_name\" content=\"Microsoft Power Platform Blog\" \/>\n<meta property=\"article:published_time\" content=\"2019-06-05T17:00:31+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-06-11T15:03:45+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/powerautomateblogmedia.azureedge.net\/powerautomateblog\/2019\/06\/1.gif\" \/>\n\t<meta property=\"og:image:width\" content=\"1688\" \/>\n\t<meta property=\"og:image:height\" content=\"429\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Jonathon Levesque\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jonathon Levesque\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/cm-edgetun.pages.dev\/en-us\/power-platform\/blog\/2019\/06\/05\/intermediate-flow-of-the-week-how-to-automate-pdf-document-generation-from-a-docx-template-using-microsoft-flow\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/cm-edgetun.pages.dev\/en-us\/power-platform\/blog\/2019\/06\/05\/intermediate-flow-of-the-week-how-to-automate-pdf-document-generation-from-a-docx-template-using-microsoft-flow\/\"},\"author\":[{\"@id\":\"https:\/\/cm-edgetun.pages.dev\/en-us\/power-platform\/blog\/author\/jonathon-levesque\/\",\"@type\":\"Person\",\"@name\":\"Jonathon Levesque\"}],\"headline\":\"Intermediate | Flow of The Week: How to automate PDF document generation from a DOCX template using Microsoft Flow\",\"datePublished\":\"2019-06-05T17:00:31+00:00\",\"dateModified\":\"2025-06-11T15:03:45+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/cm-edgetun.pages.dev\/en-us\/power-platform\/blog\/2019\/06\/05\/intermediate-flow-of-the-week-how-to-automate-pdf-document-generation-from-a-docx-template-using-microsoft-flow\/\"},\"wordCount\":904,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/cm-edgetun.pages.dev\/en-us\/power-platform\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/cm-edgetun.pages.dev\/en-us\/power-platform\/blog\/2019\/06\/05\/intermediate-flow-of-the-week-how-to-automate-pdf-document-generation-from-a-docx-template-using-microsoft-flow\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/powerautomateblogmedia.azureedge.net\/powerautomateblog\/2019\/06\/1.gif\",\"keywords\":[\"Flow of the Week\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/cm-edgetun.pages.dev\/en-us\/power-platform\/blog\/2019\/06\/05\/intermediate-flow-of-the-week-how-to-automate-pdf-document-generation-from-a-docx-template-using-microsoft-flow\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/cm-edgetun.pages.dev\/en-us\/power-platform\/blog\/2019\/06\/05\/intermediate-flow-of-the-week-how-to-automate-pdf-document-generation-from-a-docx-template-using-microsoft-flow\/\",\"url\":\"https:\/\/cm-edgetun.pages.dev\/en-us\/power-platform\/blog\/2019\/06\/05\/intermediate-flow-of-the-week-how-to-automate-pdf-document-generation-from-a-docx-template-using-microsoft-flow\/\",\"name\":\"Intermediate | Flow of The Week: How to automate PDF document generation from a DOCX template using Microsoft Flow - Microsoft Power Platform Blog\",\"isPartOf\":{\"@id\":\"https:\/\/cm-edgetun.pages.dev\/en-us\/power-platform\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/cm-edgetun.pages.dev\/en-us\/power-platform\/blog\/2019\/06\/05\/intermediate-flow-of-the-week-how-to-automate-pdf-document-generation-from-a-docx-template-using-microsoft-flow\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/cm-edgetun.pages.dev\/en-us\/power-platform\/blog\/2019\/06\/05\/intermediate-flow-of-the-week-how-to-automate-pdf-document-generation-from-a-docx-template-using-microsoft-flow\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/powerautomateblogmedia.azureedge.net\/powerautomateblog\/2019\/06\/1.gif\",\"datePublished\":\"2019-06-05T17:00:31+00:00\",\"dateModified\":\"2025-06-11T15:03:45+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/cm-edgetun.pages.dev\/en-us\/power-platform\/blog\/2019\/06\/05\/intermediate-flow-of-the-week-how-to-automate-pdf-document-generation-from-a-docx-template-using-microsoft-flow\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/cm-edgetun.pages.dev\/en-us\/power-platform\/blog\/2019\/06\/05\/intermediate-flow-of-the-week-how-to-automate-pdf-document-generation-from-a-docx-template-using-microsoft-flow\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/cm-edgetun.pages.dev\/en-us\/power-platform\/blog\/2019\/06\/05\/intermediate-flow-of-the-week-how-to-automate-pdf-document-generation-from-a-docx-template-using-microsoft-flow\/#primaryimage\",\"url\":\"https:\/\/powerautomateblogmedia.azureedge.net\/powerautomateblog\/2019\/06\/1.gif\",\"contentUrl\":\"https:\/\/powerautomateblogmedia.azureedge.net\/powerautomateblog\/2019\/06\/1.gif\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/cm-edgetun.pages.dev\/en-us\/power-platform\/blog\/2019\/06\/05\/intermediate-flow-of-the-week-how-to-automate-pdf-document-generation-from-a-docx-template-using-microsoft-flow\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/cm-edgetun.pages.dev\/en-us\/power-platform\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Intermediate | Flow of The Week: How to automate PDF document generation from a DOCX template using Microsoft Flow\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/cm-edgetun.pages.dev\/en-us\/power-platform\/blog\/#website\",\"url\":\"https:\/\/cm-edgetun.pages.dev\/en-us\/power-platform\/blog\/\",\"name\":\"Microsoft Power Platform Blog\",\"description\":\"Innovate with Business Apps\",\"publisher\":{\"@id\":\"https:\/\/cm-edgetun.pages.dev\/en-us\/power-platform\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/cm-edgetun.pages.dev\/en-us\/power-platform\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/cm-edgetun.pages.dev\/en-us\/power-platform\/blog\/#organization\",\"name\":\"Microsoft Power Platform Blog\",\"url\":\"https:\/\/cm-edgetun.pages.dev\/en-us\/power-platform\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/cm-edgetun.pages.dev\/en-us\/power-platform\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/cm-edgetun.pages.dev\/en-us\/power-platform\/blog\/wp-content\/uploads\/2020\/03\/Microsoft-Logo-e1685482038800.png\",\"contentUrl\":\"https:\/\/cm-edgetun.pages.dev\/en-us\/power-platform\/blog\/wp-content\/uploads\/2020\/03\/Microsoft-Logo-e1685482038800.png\",\"width\":194,\"height\":145,\"caption\":\"Microsoft Power Platform Blog\"},\"image\":{\"@id\":\"https:\/\/cm-edgetun.pages.dev\/en-us\/power-platform\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/cm-edgetun.pages.dev\/en-us\/power-platform\/blog\/#\/schema\/person\/017e233f3881f5857f3e7f6f221ef772\",\"name\":\"Jonathon Levesque\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/41fc5b54c4eaedb81f310f27ac37ee7ddeb02a9c5a0fe4616693f664bd6a1d7c?s=96&d=mm&r=g42ef9de3d3e22347884fca1cf41497c5\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/41fc5b54c4eaedb81f310f27ac37ee7ddeb02a9c5a0fe4616693f664bd6a1d7c?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/41fc5b54c4eaedb81f310f27ac37ee7ddeb02a9c5a0fe4616693f664bd6a1d7c?s=96&d=mm&r=g\",\"caption\":\"Jonathon Levesque\"},\"url\":\"https:\/\/cm-edgetun.pages.dev\/en-us\/power-platform\/blog\/author\/jolevesq\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Intermediate | Flow of The Week: How to automate PDF document generation from a DOCX template using Microsoft Flow - Microsoft Power Platform Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/cm-edgetun.pages.dev\/en-us\/power-platform\/blog\/2019\/06\/05\/intermediate-flow-of-the-week-how-to-automate-pdf-document-generation-from-a-docx-template-using-microsoft-flow\/","og_locale":"en_US","og_type":"article","og_title":"Intermediate | Flow of The Week: How to automate PDF document generation from a DOCX template using Microsoft Flow - Microsoft Power Platform Blog","og_description":"In this article, I will describe how to automate the creation of complex PDF documents from a template. Let us say we have a sales department. They are tired of filling the same documents with brief changes again and again. We could provide them some form for filling data and generate documents automatically.","og_url":"https:\/\/cm-edgetun.pages.dev\/en-us\/power-platform\/blog\/power-automate\/intermediate-flow-of-the-week-how-to-automate-pdf-document-generation-from-a-docx-template-using-microsoft-flow\/","og_site_name":"Microsoft Power Platform Blog","article_published_time":"2019-06-05T17:00:31+00:00","article_modified_time":"2025-06-11T15:03:45+00:00","og_image":[{"width":1688,"height":429,"url":"https:\/\/powerautomateblogmedia.azureedge.net\/powerautomateblog\/2019\/06\/1.gif","type":"image\/png"}],"author":"Jonathon Levesque","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Jonathon Levesque","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/cm-edgetun.pages.dev\/en-us\/power-platform\/blog\/2019\/06\/05\/intermediate-flow-of-the-week-how-to-automate-pdf-document-generation-from-a-docx-template-using-microsoft-flow\/#article","isPartOf":{"@id":"https:\/\/cm-edgetun.pages.dev\/en-us\/power-platform\/blog\/2019\/06\/05\/intermediate-flow-of-the-week-how-to-automate-pdf-document-generation-from-a-docx-template-using-microsoft-flow\/"},"author":[{"@id":"https:\/\/cm-edgetun.pages.dev\/en-us\/power-platform\/blog\/author\/jonathon-levesque\/","@type":"Person","@name":"Jonathon Levesque"}],"headline":"Intermediate | Flow of The Week: How to automate PDF document generation from a DOCX template using Microsoft Flow","datePublished":"2019-06-05T17:00:31+00:00","dateModified":"2025-06-11T15:03:45+00:00","mainEntityOfPage":{"@id":"https:\/\/cm-edgetun.pages.dev\/en-us\/power-platform\/blog\/2019\/06\/05\/intermediate-flow-of-the-week-how-to-automate-pdf-document-generation-from-a-docx-template-using-microsoft-flow\/"},"wordCount":904,"commentCount":0,"publisher":{"@id":"https:\/\/cm-edgetun.pages.dev\/en-us\/power-platform\/blog\/#organization"},"image":{"@id":"https:\/\/cm-edgetun.pages.dev\/en-us\/power-platform\/blog\/2019\/06\/05\/intermediate-flow-of-the-week-how-to-automate-pdf-document-generation-from-a-docx-template-using-microsoft-flow\/#primaryimage"},"thumbnailUrl":"https:\/\/powerautomateblogmedia.azureedge.net\/powerautomateblog\/2019\/06\/1.gif","keywords":["Flow of the Week"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/cm-edgetun.pages.dev\/en-us\/power-platform\/blog\/2019\/06\/05\/intermediate-flow-of-the-week-how-to-automate-pdf-document-generation-from-a-docx-template-using-microsoft-flow\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/cm-edgetun.pages.dev\/en-us\/power-platform\/blog\/2019\/06\/05\/intermediate-flow-of-the-week-how-to-automate-pdf-document-generation-from-a-docx-template-using-microsoft-flow\/","url":"https:\/\/cm-edgetun.pages.dev\/en-us\/power-platform\/blog\/2019\/06\/05\/intermediate-flow-of-the-week-how-to-automate-pdf-document-generation-from-a-docx-template-using-microsoft-flow\/","name":"Intermediate | Flow of The Week: How to automate PDF document generation from a DOCX template using Microsoft Flow - Microsoft Power Platform Blog","isPartOf":{"@id":"https:\/\/cm-edgetun.pages.dev\/en-us\/power-platform\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/cm-edgetun.pages.dev\/en-us\/power-platform\/blog\/2019\/06\/05\/intermediate-flow-of-the-week-how-to-automate-pdf-document-generation-from-a-docx-template-using-microsoft-flow\/#primaryimage"},"image":{"@id":"https:\/\/cm-edgetun.pages.dev\/en-us\/power-platform\/blog\/2019\/06\/05\/intermediate-flow-of-the-week-how-to-automate-pdf-document-generation-from-a-docx-template-using-microsoft-flow\/#primaryimage"},"thumbnailUrl":"https:\/\/powerautomateblogmedia.azureedge.net\/powerautomateblog\/2019\/06\/1.gif","datePublished":"2019-06-05T17:00:31+00:00","dateModified":"2025-06-11T15:03:45+00:00","breadcrumb":{"@id":"https:\/\/cm-edgetun.pages.dev\/en-us\/power-platform\/blog\/2019\/06\/05\/intermediate-flow-of-the-week-how-to-automate-pdf-document-generation-from-a-docx-template-using-microsoft-flow\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/cm-edgetun.pages.dev\/en-us\/power-platform\/blog\/2019\/06\/05\/intermediate-flow-of-the-week-how-to-automate-pdf-document-generation-from-a-docx-template-using-microsoft-flow\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/cm-edgetun.pages.dev\/en-us\/power-platform\/blog\/2019\/06\/05\/intermediate-flow-of-the-week-how-to-automate-pdf-document-generation-from-a-docx-template-using-microsoft-flow\/#primaryimage","url":"https:\/\/powerautomateblogmedia.azureedge.net\/powerautomateblog\/2019\/06\/1.gif","contentUrl":"https:\/\/powerautomateblogmedia.azureedge.net\/powerautomateblog\/2019\/06\/1.gif"},{"@type":"BreadcrumbList","@id":"https:\/\/cm-edgetun.pages.dev\/en-us\/power-platform\/blog\/2019\/06\/05\/intermediate-flow-of-the-week-how-to-automate-pdf-document-generation-from-a-docx-template-using-microsoft-flow\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/cm-edgetun.pages.dev\/en-us\/power-platform\/blog\/"},{"@type":"ListItem","position":2,"name":"Intermediate | Flow of The Week: How to automate PDF document generation from a DOCX template using Microsoft Flow"}]},{"@type":"WebSite","@id":"https:\/\/cm-edgetun.pages.dev\/en-us\/power-platform\/blog\/#website","url":"https:\/\/cm-edgetun.pages.dev\/en-us\/power-platform\/blog\/","name":"Microsoft Power Platform Blog","description":"Innovate with Business Apps","publisher":{"@id":"https:\/\/cm-edgetun.pages.dev\/en-us\/power-platform\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/cm-edgetun.pages.dev\/en-us\/power-platform\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/cm-edgetun.pages.dev\/en-us\/power-platform\/blog\/#organization","name":"Microsoft Power Platform Blog","url":"https:\/\/cm-edgetun.pages.dev\/en-us\/power-platform\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/cm-edgetun.pages.dev\/en-us\/power-platform\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/cm-edgetun.pages.dev\/en-us\/power-platform\/blog\/wp-content\/uploads\/2020\/03\/Microsoft-Logo-e1685482038800.png","contentUrl":"https:\/\/cm-edgetun.pages.dev\/en-us\/power-platform\/blog\/wp-content\/uploads\/2020\/03\/Microsoft-Logo-e1685482038800.png","width":194,"height":145,"caption":"Microsoft Power Platform Blog"},"image":{"@id":"https:\/\/cm-edgetun.pages.dev\/en-us\/power-platform\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/cm-edgetun.pages.dev\/en-us\/power-platform\/blog\/#\/schema\/person\/017e233f3881f5857f3e7f6f221ef772","name":"Jonathon Levesque","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/41fc5b54c4eaedb81f310f27ac37ee7ddeb02a9c5a0fe4616693f664bd6a1d7c?s=96&d=mm&r=g42ef9de3d3e22347884fca1cf41497c5","url":"https:\/\/secure.gravatar.com\/avatar\/41fc5b54c4eaedb81f310f27ac37ee7ddeb02a9c5a0fe4616693f664bd6a1d7c?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/41fc5b54c4eaedb81f310f27ac37ee7ddeb02a9c5a0fe4616693f664bd6a1d7c?s=96&d=mm&r=g","caption":"Jonathon Levesque"},"url":"https:\/\/cm-edgetun.pages.dev\/en-us\/power-platform\/blog\/author\/jolevesq\/"}]}},"bloginabox_animated_featured_image":null,"bloginabox_display_generated_audio":false,"distributor_meta":false,"distributor_terms":false,"distributor_media":false,"distributor_original_site_name":"Microsoft Power Platform Blog","distributor_original_site_url":"https:\/\/cm-edgetun.pages.dev\/en-us\/power-platform\/blog","push-errors":false,"_links":{"self":[{"href":"https:\/\/cm-edgetun.pages.dev\/en-us\/power-platform\/blog\/wp-json\/wp\/v2\/posts\/1111","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cm-edgetun.pages.dev\/en-us\/power-platform\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cm-edgetun.pages.dev\/en-us\/power-platform\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cm-edgetun.pages.dev\/en-us\/power-platform\/blog\/wp-json\/wp\/v2\/users\/348"}],"replies":[{"embeddable":true,"href":"https:\/\/cm-edgetun.pages.dev\/en-us\/power-platform\/blog\/wp-json\/wp\/v2\/comments?post=1111"}],"version-history":[{"count":1,"href":"https:\/\/cm-edgetun.pages.dev\/en-us\/power-platform\/blog\/wp-json\/wp\/v2\/posts\/1111\/revisions"}],"predecessor-version":[{"id":130871,"href":"https:\/\/cm-edgetun.pages.dev\/en-us\/power-platform\/blog\/wp-json\/wp\/v2\/posts\/1111\/revisions\/130871"}],"wp:attachment":[{"href":"https:\/\/cm-edgetun.pages.dev\/en-us\/power-platform\/blog\/wp-json\/wp\/v2\/media?parent=1111"}],"wp:term":[{"taxonomy":"audience","embeddable":true,"href":"https:\/\/cm-edgetun.pages.dev\/en-us\/power-platform\/blog\/wp-json\/wp\/v2\/audience?post=1111"},{"taxonomy":"content-type","embeddable":true,"href":"https:\/\/cm-edgetun.pages.dev\/en-us\/power-platform\/blog\/wp-json\/wp\/v2\/content-type?post=1111"},{"taxonomy":"job-role","embeddable":true,"href":"https:\/\/cm-edgetun.pages.dev\/en-us\/power-platform\/blog\/wp-json\/wp\/v2\/job-role?post=1111"},{"taxonomy":"product","embeddable":true,"href":"https:\/\/cm-edgetun.pages.dev\/en-us\/power-platform\/blog\/wp-json\/wp\/v2\/product?post=1111"},{"taxonomy":"property","embeddable":true,"href":"https:\/\/cm-edgetun.pages.dev\/en-us\/power-platform\/blog\/wp-json\/wp\/v2\/property?post=1111"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/cm-edgetun.pages.dev\/en-us\/power-platform\/blog\/wp-json\/wp\/v2\/topic?post=1111"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/cm-edgetun.pages.dev\/en-us\/power-platform\/blog\/wp-json\/wp\/v2\/coauthors?post=1111"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}