I am generating pdf document but document may contains special characters like (’,>,<,*,",) so i am getting error,
is there any way to resolve this ?
Discussion posts and replies are publicly visible
DOCX is a XML document. You need to XML escape these characters.
a!localVariables( local!searchString: cons!GAI_XML_CHARS_TO_ESCAPE, local!replaceString: { "&", "'", "<", ">", """ }, local!indexFirstCharacter: if( a!isNullOrEmpty(ri!charsToEscape), null, cast( typeof(0), wherecontains( tostring(index(ri!charsToEscape, 1, null)), touniformstring(local!searchString) ) ) ), local!replaceFirstChar: if( a!isNullOrEmpty(ri!charsToEscape), null, regexreplaceall( tostring( local!searchString[local!indexFirstCharacter] ), ri!inputString, tostring( local!replaceString[local!indexFirstCharacter] ) ) ), local!nextCharsToEscape: remove(ri!charsToEscape, 1), if( a!isNullOrEmpty(local!nextCharsToEscape), local!replaceFirstChar, rule!GAI_Common_EscapeXMLCharacters( inputString: local!replaceFirstChar, charsToEscape: local!nextCharsToEscape ) ) )
i am using above code to escape char, but in PDF instead of & showing &
OpenXML seems to be a bit different. Check the last comment here:
stackoverflow.com/.../ooxml-sdk-illegal-character-replacements