OfficeToPDF hangs with nested conditionals and table loops nested in a conditional (C++ SDK)

Product: PDFTron SDK (C++ 64-bit), Trial License

Product Version: 9.2.0

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

Nested conditionals and table loops cause C++ app to hang at the call to OfficeToPDF.

Please describe your issue and provide steps to reproduce it:

I am having trouble using nested conditionals and nested table loops within a conditional, using the OfficeToPDF function in the C++ PDFTron SDK. Using the OfficeTemplateTestVC2019 sample and the json text pasted below, each of the commands in problems.docx (attached below) causes the app to hang.
Interestingly, if I post the same document to the Online Demo, everything works as intended.

Please provide a link to a minimal sample where the issue is reproducible:
problems.docx (13.2 KB)

json = "{\
				\"A\": false,\
				\"B\" : false,\
				\"D\" : true,\
				\"X\" : false,\
				\"Y\" : true,\
				\"rows\" : [\
				{\
					\"c1\": \"11\",\
					\"c2\" : \"12\"\
				},\
				{\
					\"c1\": \"21\",\
					\"c2\" : \"22\"\
				}\
				] ,\
				\"rowsX\": [\
				{\
					\"c1\": \"1\",\
					\"c2\" : \"2\"\
				},\
				{\
					\"c1\": \"3\",\
					\"c2\" : \"4\"\
				}\
				] ,\
				\"rowsY\": [\
				{\
					\"c1\": \"1\",\
					\"c2\" : \"2\",\
					\"c3\" : \"3\"\
				},\
				{\
					\"c1\": \"4\",\
					\"c2\" : \"5\",\
					\"c3\" : \"6\"\
				}\
				],\
				\"rowsZ\": [\
				{\
					\"c1\": \"1\",\
					\"c2\" : \"2\",\
					\"c3\" : \"3\",\
					\"c4\" : \"4\"\
				},\
				{\
					\"c1\": \"5\",\
					\"c2\" : \"6\",\
					\"c3\" : \"7\",\
					\"c4\" : \"8\"\
				}\
				],\
				\"title\": \"title\"\
		}";

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:APIs:Forums:

Hello,

It looks like you have not correctly placed your escape characters in the JSON string, as the boolean values need to be surrounded with them as well:

For example: "{\"A\": \"false\", \"B\": \"false\"

For reference, here is a JSON string example in the OfficeTemplateTest sample:

UString json(
	"{\"dest_given_name\": \"Janice N.\", \"dest_street_address\": \"187 Duizelstraat\", \"dest_surname\": \"Symonds\", \"dest_title\": \"Ms.\", \"land_location\": \"225 Parc St., Rochelle, QC \","
	"\"lease_problem\": \"According to the city records, the lease was initiated in September 2010 and never terminated\", \"logo\": {\"image_url\": \"" + input_path + "logo_red.png\", \"width\" : 64, \"height\" : 64},"
	"\"sender_name\": \"Arnold Smith\"}"
);

Please let me know if this works for you.

Hello,

Thank you very much for your suggestion! I tried that but the execution still hangs in the same way unfortunately… It is worth noting that the online demo does not add quotes to the booleans, but everything works as intended on the online demo.