Loading...
Skip to end of metadata
Go to start of metadata

You might see PDF documents with file names created using Unicode characters, such as with CJKV (Chinese, Japanese, Korean, or Vietnamese) characters, like this:

Typically the file will not open directly. Use the ASGetDefaultUnicodeFileSys() method to obtain an ASFileSys file system name for the document, and then pass that name to the PDDocOpen call.

For example, the file name passed to PDDocOpen call is “sample.PDF”:

  #define IN_FILE "./sample.pdf"
  ...
  ASFileSys asFileSys = ASGetDefaultUnicodeFileSys();
  asPathName = ASFileSysCreatePathName(asFileSys, ASAtomFromString("Cstring"), IN_FILE, 0);
  pdDoc = PDDocOpen(asPathName, asFileSys, NULL, true);

In Windows, you can also use the WinUnicodePath ASAtom:

  #define IN_FILE_WIDE L"./sample.pdf"
  ...
  ASFileSys asFileSys = ASGetDefaultUnicodeFileSys();
  asPathName = ASFileSysCreatePathName(asFileSys, ASAtomFromString("WinUnicodePath"), IN_FILE_WIDE, 0);
  pdDoc = PDDocOpen(asPathName, asFileSys, NULL, true); 

Adobe PDF Library supports Unicode paths for Windows, Mac, and Unix platforms.

See the section "Creating an ASFileSys object that supports Unicode paths" in the section “Developing Plug-ins and Applications” in the Adobe PDF Library API Reference for further information. This is provided as a separate download with the APDFL software installation package, and is also available from an Adobe Systems web site.

  • No labels