We need to convert an MS Word document (2007) to pdf format and need an an appro

We need to convert an MS Word document (2007) to pdf format and need an an approach that produces an accurate rendering. We expected the Pdf From Docx smart service to do the deed, but have encountered two problems (so far). First, Pdf From Docx doesn't use the Appian Document Manager's current version of the document (it uses the initial version). We've gotten around this feature by using the Copy Document Service smart service to create a temporary copy of the document (only one version is created and it's based on the current version of the original). The second, and more serious problem is the format of the resulting pdf. The format is different, there are extraneous data, and font formats are not preserved (e.g., bold). Suggestions?...

OriginalPostID-122382

OriginalPostID-122382

  Discussion posts and replies are publicly visible

  • You may find better results using the Dynamic Document Generator shared component, which should use the latest version of your .docx stored in Appian.
  • Correction -
    I still recommend the DDG plugin. But, I've never worried about document versions. So perhaps in your testing you can confirm that it uses the latest version.
    Typically, when I create pdf from docx in this manner, I have a brand new (v1) word doc (created using the word doc from template smart service), and then convert that to pdf immediately.
    Is this a boilerplate document or a "merged" document that you're wanting to convert?
  • Thanks for the recommendation. We upgraded to the latest version with some success. The upgrade corrected the document version issue and some of the formatting. However, the PDF conversion is still challenged when there's a merge field in the header of the document.
  • Gene - Are you familiar with MS Word's document.xml file that lives inside your word doc?

    If your document.xml looks like this:

    ###</w:t></w:r><w:r w:rsidR="00037C59"><w:rPr><w:sz w:val="22"/><w:szCs w:val="22"/><w:highlight w:val="yellow"/></w:rPr><w:t>mergeField1</w:t></w:r><w:r w:rsidRPr="008F6B19"><w:rPr><w:sz w:val="22"/><w:szCs w:val="22"/><w:highlight w:val="yellow"/></w:rPr><w:t>###

    Then the merge will not work (your tags might be different depending on formatting)

    you can go ahead and remove the extraneous tags between the hashes and your token:
    ###mergeField1###

    That should get merged.