Dynamics 365 Business Central: Convert Word (.docx) To PDF (.pdf) within BC (No control add-in and APIs)
Converting Word documents to PDF format within Business Central can be achieved using the built-in ConvertWordToPdf procedure from codeunit 9651 without requiring control add-ins or external APIs. The post demonstrates two practical approaches: converting attached Word documents and uploading documents for conversion, with complete source code examples.

post Dynamics 365 Lab
"codeunit 9651 "Document Report Mgt." -> procedure ConvertWordToPdf(var TempBlob: Codeunit "Temp Blob"; ReportID: Integer)"
Key points
- Use codeunit 9651 Document Report Mgt. and its ConvertWordToPdf procedure to convert DOCX files to PDF
- No control add-ins or external APIs required for the conversion functionality
- Can integrate conversion into page extensions to add Word-to-PDF conversion actions
- The method handles document attachments through temp blob objects for streaming
Quotes
- “codeunit 9651 “Document Report Mgt.” -> procedure ConvertWordToPdf(var TempBlob: Codeunit “Temp Blob”; ReportID: Integer)” (Identifies the exact system procedure developers should use for Word-to-PDF conversion without external tools)
AL objects mentioned
As named in the post. A name that matches one object page by exact type and name links to it; the others stay as named.
- codeunit 9651 “Document Report Mgt.”
- codeunit 4100 “Temp Blob”
- codeunit 419 “File Management”
- page 1173 “Document Attachment Details”
- page 22 “Customer List”
Possibly related
No source states these links: they share an object, a model read them, or a person found the same subject.
- 🕐 Remember When Lists Could Sort By Any Key? 🔄 — possibly related: both name Page 22 “Customer List”
- All new goodies about AL Namespace in BC 2025 wave 2 — possibly related: both name Page 22 “Customer List”
- Attachment capabilities and limitations (preview) — possibly related: names Codeunit 4100 “Temp Blob”
- Business Central v29: System Audit Fields Now Available in Analysis Mode — possibly related: both name Page 22 “Customer List”
- Dynamics 365 Business Central: Convert Word (.docx) To HTML (.html) within BC (No control add-in and APIs) — possibly related: both name Codeunit 9651 “Document Report Mgt.”
- Dynamics 365 Business Central: Generate Swiss QR Code without external services/APIs — possibly related: both name Codeunit 4100 “Temp Blob”
- Dynamics 365 Business Central: How to get current Profile (Role) info (Profile ID, Display Name, Source, Role Center ID, etc.) via AL — possibly related: both name Page 22 “Customer List”
- Dynamics 365 Business Central: How to get the page number of a PDF or Word file in AL (Display the page count on Attached Documents and Doc. Attachment List Factbox) — possibly related: both name Page 1173 “Document Attachment Details”
- Dynamics 365 Business Central: How to hide/disable New, Edit (Edit List), and Delete actions on the page — possibly related: both name Page 22 “Customer List”
- Dynamics 365 Business Central: How to preview Word (.docx) in web client without downloading (No control add-in and APIs) — possibly related: both name Codeunit 9651 “Document Report Mgt.”
Heads up
- warning: “The document contains elements that cannot be converted to PDF. This may be caused by missing image data in the document.”
Context
- Features: Convert Word to PDF, Document attachments, Word layouts, File conversion, Stream handling
Source: Dynamics 365 Lab - Yun Zhu, community blog. Summary, key points and quotes are derived (CONTENT-NOTICE.md); read the original for the full text.