FillTemplateJson function not working - Python 3

Product: PDFNetPython3

Product Version: 9.3.0

Please give a brief summary of your issue:
(Think of this as an email subject)

We’re following the guide PDFTron Systems Inc. | Documentation, up to:

template_doc = Convert.CreateOfficeTemplate(input_path + input_filename, None)

The variable template_doc does not have the method FillTemplateJson. In fact, the only methods it has are acquire, append, disown, next, and own. It’s also of type <Swig Object of type ’TemplateDocument *’> which seems to be a C pointer towards the object instead of the object itself. We’re not quite sure what the reason is, and it’s difficult to debug since there is no error.

It should be noted that the guide above seems to be in Python2 whereas we are using Python 3.8.10.

Please describe your issue and provide steps to reproduce it:
(The more descriptive your answer, the faster we are able to help you)

json_input = {
  name : "James Rodigues",
}
template_doc = Convert.CreateOfficeTemplate("filename.docx", None)
pdfdoc = template_doc.FillTemplateJson(json_input)

Please provide a link to a minimal sample where the issue is reproducible:

Hello, I’m Ron, an automated tech support bot :robot:

While you wait for one of our customer support representatives to get back to you, please check out some of these documentation pages:

Guides:Forums:

Thank you for contacting us about this. We will look into this further on our end. As a workaround, it is possible to achieve the same result with the OfficeToPDFOptions class. You can refer to the code below which comes from the sample download:

pdfdoc = PDFDoc()

options = OfficeToPDFOptions()
options.SetTemplateParamsJson(json_input)

# perform the conversion with template delimiters and content dictionary
Convert.OfficeToPDF(pdfdoc, input_path + input_filename, options)

# save the result
pdfdoc.Save(output_path + output_filename, SDFDoc.e_linearized)

# And we're done!
print("Saved " + output_filename )

Hi shakthi124
Thanks for you help. I have use it and it is working super. But I am getting a diferent error related to convert class and is that I also need getTemplateKeysJson() method.
Have you ane workaround to use this ?