{"id":395,"date":"2016-04-20T15:39:17","date_gmt":"2016-04-20T13:39:17","guid":{"rendered":"http:\/\/blogs.msdn.microsoft.com\/lavanack\/?p=395"},"modified":"2022-05-30T13:51:13","modified_gmt":"2022-05-30T11:51:13","slug":"docx-to-pdf-powershell","status":"publish","type":"post","link":"https:\/\/laurentvanacker.com\/index.php\/2016\/04\/20\/docx-to-pdf-powershell\/","title":{"rendered":"Convertir plusieurs documents Word en PDF via PowerShell \/ How to convert multiple Word documents into a PDF document in a row with PowerShell"},"content":{"rendered":"<div id=\"fr-FR\"><a href=\"#en-US\">English version<\/a><\/div>\n<p>&nbsp;<\/p>\n<p><span lang=\"en\">[MAJ 06\/03\/2017] <\/span>Les versions les plus r\u00e9centes de Word permettent de convertir (et \u00e9galement d&rsquo;ouvrir) un document Word en PDF (via le menu \u00ab\u00a0File &gt;&gt; Save As\u00a0\u00bb pour la conversion). Cette fonctionnalit\u00e9 , quoique tr\u00e8s pratique, ne permet que de convertir un document \u00e0 la fois (apr\u00e8s avoir ouvert le document dans l&rsquo;application Word). Dans ma vie de PFE, je suis amen\u00e9 \u00e0 \u00e9crire et \u00e0 mettre \u00e0 jour beaucoup de documentations (formations, rapports \u00e0 destination de clients, documentations internes, compte-rendus de r\u00e9unions, &#8230;) et dans certains je dois les envoyer au format PDF. Vous imaginez bien que dans le cas de plusieurs fichiers \u00e0 convertir je ne vais pas les ouvrir 1 par 1 dans Word. Au lieu de cela j&rsquo;ai \u00e9crit une petit script PowerShell que j&rsquo;ai d\u00e9cid\u00e9 de vous partager <a href=\"https:\/\/github.com\/lavanack\/laurentvanacker.com\/blob\/master\/Windows%20Powershell\/Office\/Word\/ConvertTo-PDF.ps1\" target=\"_blank\" rel=\"noopener noreferrer\">ici<\/a>.<\/p>\n<hr \/>\n<div id=\"en-US\"><a href=\"#fr-FR\">Version fran\u00e7aise<\/a><\/div>\n<p>&nbsp;<\/p>\n<div id=\"gt-c\" class=\"g-section\">\n<div id=\"gt-form-c\">\n<form id=\"gt-form\" action=\"\/\" method=\"post\" name=\"text_form\">\n<div id=\"gt-text-all\">\n<div id=\"gt-main\">\n<div id=\"gt-text-c\">\n<div id=\"gt-text-top\">\n<div id=\"gt-res-c\" class=\"g-unit\">\n<div id=\"gt-res-p\">\n<div id=\"gt-res-data\">\n<div id=\"gt-res-wrap\">\n<div id=\"gt-res-content\" class=\"almost_half_cell\">\n<div dir=\"ltr\"><span id=\"result_box\" lang=\"en\">[Updated 03\/06\/2017] The most recent versions of Word give you the opportunity to convert (and also to open) a Word document into a PDF document (via the \u00ab\u00a0File &gt;&gt; Save As\u00a0\u00bb Menu for the conversion feature). This feature, though very convenient, can only convert one document at a time (after opening the document in the Word application). In my PFE life, I write and update many documentations (WorkShops, customer reports, internal documents, minutes of meetings, &#8230;) and sometimes I have to send them in the PDF Format. You can imagine that in the case of multiple files to convert I will not open them one by one in Word. Instead I wrote a small PowerShell script that I decided to share with you <a href=\"https:\/\/github.com\/lavanack\/laurentvanacker.com\/blob\/master\/Windows%20Powershell\/Office\/Word\/ConvertTo-PDF.ps1\" target=\"_blank\" rel=\"noopener noreferrer\">here<\/a>.<\/span><\/div>\n<div dir=\"ltr\"><\/div>\n<div dir=\"ltr\">Laurent<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/form>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>English version &nbsp; [MAJ 06\/03\/2017] Les versions les plus r\u00e9centes de Word permettent de convertir (et \u00e9galement d&rsquo;ouvrir) un document Word en PDF (via le [&#8230;]<\/p>\n","protected":false},"author":2,"featured_media":2463,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,19,13],"tags":[31,60,39,46],"class_list":["post-395","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-office","category-powershell","category-word","tag-office","tag-pdf","tag-powershell","tag-word"],"_links":{"self":[{"href":"https:\/\/laurentvanacker.com\/index.php\/wp-json\/wp\/v2\/posts\/395","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/laurentvanacker.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/laurentvanacker.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/laurentvanacker.com\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/laurentvanacker.com\/index.php\/wp-json\/wp\/v2\/comments?post=395"}],"version-history":[{"count":7,"href":"https:\/\/laurentvanacker.com\/index.php\/wp-json\/wp\/v2\/posts\/395\/revisions"}],"predecessor-version":[{"id":2882,"href":"https:\/\/laurentvanacker.com\/index.php\/wp-json\/wp\/v2\/posts\/395\/revisions\/2882"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/laurentvanacker.com\/index.php\/wp-json\/wp\/v2\/media\/2463"}],"wp:attachment":[{"href":"https:\/\/laurentvanacker.com\/index.php\/wp-json\/wp\/v2\/media?parent=395"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/laurentvanacker.com\/index.php\/wp-json\/wp\/v2\/categories?post=395"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/laurentvanacker.com\/index.php\/wp-json\/wp\/v2\/tags?post=395"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}