We are using Acrobat plug-in to save PDF from our application. For one particular scenario we are trying to save a non-english filename (like Chinese, Japanese, Korean, etc) to PDF. We are using AFExecuteThisScript to call the saveAs method to actually save the PDF file.
As per documentation we found here:
ASBool AFExecuteThisScript (PDDoc pdd, const char * cScript, char ** pRetValue)
pdd The PDDoc in which the script is to be executed.
cScript A string containing the text of the script to be executed. If Unicode, the string must begin with
0xFEFF and end with 2 null bytes. If this is not the case, it is assumed to be in the application's language
encoding, as returned by AVAppGetLanguageEncoding.
pRetValue To get a return value from the execution of the script, pass a non-NULL value for this
parameter. If on return - pRetVal is non-NULL, the caller should dispose of the string by calling ASFree. If
present, the value will be in host encoding. NOTE: The script sets this value by assigning it to event.value.
We tried passing the UTF-8 string from our application and have added to start with 0xFEFF and end with 2 null bytes, but still we are getting the ANSI name PDF filename.
It would be great if an example can be provided for the usage of AFExecuteThisScript() method for non-english characters to be passed to this function.
Post the question in the forum for Acrobat SDK.
[Question moved to the relevant forum]