Skip to main content

HSD’s Functional Architect (Dynamics 365) – Jaydeep Wagh runs us through how to generate documents with barcode content using Dynamics 365 PDF generation engine.

Business use case:

During a project implementation, to fulfil the requirement of PDF generation on custom entity, we ended up calling a Dynamics 365 service endpoint for PDF generation via Power Automate cloud flows. There are lots of examples online shared by multiple community members similar to the approach we used as per Stefan’s solution. You can generate PDF documents by calling the service endpoint and passing document template details and target record details in the JSON request body.

Web API endpoint: e.g. How it would look like when the PDF is generated

As displayed in the screenshot above, without embedded font, system displays numbers only.


Embed respective font in respective word template file. Here are the steps based on our experience or issues we have faced while embedding font within the word document template.

  1. Open word document template
  2. Insert field to the word document template as ‘Rich Text’ field.

3. Upon inserting a variable field it will appear as highlighted field in the screenshot below.

4. Set font of the field to ‘Barcode’ font as shown below.

P. Note: Now if we upload the word document template to Dynamics 365 CRM instance. Then upon generating PDF then field will be displayed as text value and not barcode value

To address this issue please execute steps below.

5. Access  File-> Options-> Save

Please make sure the highlighted check box in the screenshot below is unticked. If selected, word is not able to determine barcode font characters and as a result does not generate/print barcode.

If we embed, only the characters in the template it will only embed font characters related to the field name only and not all characters. When the field is dynamically generated, it will require the whole set of characters and not only characters related to the field name.

6. Final output

Here is the final output:

We, at HSD, successfully managed to implement font embedding in the context of our requirement of PDF generation on Dynamics 365 (online). I believe solution of embedding a font is applicable for any technology, platform where word document is used.

More info at