Getting PDF filename with unicode chars

Hello,
I'm trying to write a plugin that gets the file path of the current active document. The code looks like this:
AVDoc avDoc = AVAppGetActiveDoc();
PDDoc pdDoc = AVDocGetPDDoc(avDoc);
ASFile file = PDDocGetFile (pdDoc);
ASPathName filePath = ASFileAcquirePathName (file);
This works fine for most documents, but for documents with unicode characters in the name each unicode character is replaced with '.' in filePath. For example, if the document is "测试中文关键词搜索!@#$%^&().pdf", then filePath becomes ".........!@#$%^&().pdf". Am I missing something required to get unicode filenames?
Thanks.

You were right, the plugin was getting a char* from ASFileSysDisplayStringFromPath. I removed that and added this which seems to have fixed my problem:
ASText pathText = ASTextNew();
ASFileSysDisplayASTextFromPath(ASGetDefaultFileSys(), filePath, pathText);
wchar_t *pathString = (wchar_t*)ASTextGetUnicode(pathText);
Thank you!

Similar Messages

  • Filenames with unicode characters

    Hello, I have a question regarding filenames with unicode characters on an arabic windows xp.
    I have a string, which the user entered and want to create a file with this string as filename. So my question:
    Which unicode characters are allowed in a filename? I know, that on a german windows " / \ * ? < > : * are not allowed from the ASCII set, but which unicode chars are allowed? Is this language dependend on windows? Maybe there exists a method, which checks a string for this allowed characters.
    Thanks for your help

    AFAIK the illegal characters are always the same (you listed them already) and as long as the filesystem supports it (read: you use NTFS and not FAT) you may use any other unicode character.
    You might have troubles displaying those characters 'though if you don't happen to have the correct fonts installed, but that would only be a cosmetic issue.

  • Trouble with Unicode Chars

    Hi all,
    I am having trouble displaying Unicode chars both in an Applet and in the command prompt window. I am using awt. The characters I want to display are: \u2228, \u2283, \u2261. These characters display correctly from AppletViewer when I add them to ChoiceBoxes, they display correctly in some browsers (isn't Unicode fairly universal by now? Do most browsers support it?), but not correctly when I try to put them into a TextField, using this simple code:
    public void keyTyped(KeyEvent e) {
    if(e.getKeyChar() == '/') {
    e.setKeyChar('\u2228');
    if(e.getKeyChar() == '.') {
    e.setKeyChar('\u2283');
    System.out.println(e.getKeyChar());
    if(e.getKeyChar() == ',') {
    e.setKeyChar('\u2261');
    System.out.println(e.getKeyChar());
    Any help is greatly appreciated, thanks!

    Er, forgot to mention, the chars display as either a
    black bar, sort of a square, This happens when there is no suitable font for the codepoint, and the system doesn't know how to convert a codepoint to another codepoint for which there is a suitable font. The latter mechanism allow to use non-unicode fonts with unicode chars.
    a question mark, That's possibly another issue. '?' usually appears while
    converting chara�ter into bytes, specifically if an encoding doesn't have an appropriate rule for a particular character.
    For example, the "Cp1251" encoding knows nothing of Greek characters, and so converts them into ?'s.
    Such conversion may occur when a java string is passed
    into a native window system, because such systems often are non-unicode.
    and an equal signCompletely illegal behaviour, usually occurs in very old JVM's.
    Note that Swing is always correct with unicode.
    A relevant documentation is here:
    http://java.sun.com/j2se/1.3/docs/guide/intl/addingfonts.html
    and
    http://java.sun.com/j2se/1.3/docs/guide/intl/fontprop.html

  • Why do I get pdf files with an underscore  in the extension ( ._pdf)

    Why do I get pdf files with an underscore  in the extension ( ._pdf)  and how do I  open them when they are email attachemnts, becuase it wont let me rename it or save it as any other version.

    Not sure. What email are you using? Gmail (or web based email) by chance?
    Definitely not a Reader issue if you can see the underscore in your email.
    You can try saving it as is then try renaming it using Windows Explorer to see if that works.

  • Get current PDF path when filename has unicode chars

    How do i get the current PDF path if the filename has unicode characters
    Thanks
    Swapneel

    How are you getting it now that it isn't working?

  • Get pdf filename during initialize:

    I wonder to get the pdf filename during initialize, may i know is it possible?
    Thanks your concern.
    Tham

    ASFileSysOpenProc is not suitable. It is used for the opening of all
    files, not just PDF files, and you do not provide it for the standard
    filesystem: it is a standard part of Acrobat.
    Since it is documents you are interested in, rather than files, you
    would want to look at the document related callbacks (CosDoc, PDDoc,
    AVDoc). I can see why you wouldn't find it though, the Acrobat API
    documents are breathtakingly awful, ever since someone had the bright
    idea of replacing a human editor with a programmer generated file.
    You need to use the PDDocDidOpen notification (notification is the
    buzzword here, not callback), registered with
    AVAppRegisterNotification. Try documents from an older version of the
    SDK, the Acrobat 8 SDK is beyond a joke.
    Aandi Inston

  • Getting pdf's with pics on my touch

    Hi there,
    I have downloaded to my PC a magazine with pictures in it. I want to be able to move it to my I-touch so i can read it as and when. I have e used Discover with limited results. Some PDF's with images have worked.... this was an instruction manual with limited images in it. However, when i have moved the Mag and a book that I have, the images have been deleted? Why is this?
    What else can I use as i really want to read these things but want them on my itouch.
    Please help, no one seems to know the answer.

    check out Documents To Go and Flash Drive.
    JGG

  • Acrobat 9 Batch Processing - Get PDF filenames from folder?

    Hello,
    Can anyone provide me with an example with how to use Batch Processing (when set to a specific folder/files) to get a list of filenames in that folder? I haven't been able to find any examples online. There doesn't seem to be any built in batch sequences that automatically do this so I assume it will need to be done with javascript?
    Ultimately, I need to automate a process (I was hoping to create a batch sequence to accomplish this) that will allow me to prompt a user to pick a source folder of PDFs and then based on that selection, run a Javascript that I create which will merge all PDFs in that folder into a new PDF, apply some crop setttings to each page, and then prompt the user where to save the merged PDF?
    Has anyone ever done anything like this? I would love to see an example of how this might be able to be achieved.
    Many thanks in advance.

    Have you tried to create a test batch process (now called Actions)?  Actions in Acrobat 10 has the "merge all files in folder" option, and batch processing in previous versions has always included a page crop commad as well as an option for asking the user where to save the file.
    There are lots of examples and articles on this topic at http://www.acrobatusers.com
    Thom Parker
    The source for PDF Scripting Info
    pdfscripting.com
    The Acrobat JavaScript Reference, Use it Early and Often
    Then most important JavaScript Development tool in Acrobat
    The Console Window (Video tutorial)
    The Console Window(article)

  • Does photoshop cs5 sdk support file names with unicode characters?

    Hi,
    For the export module, does the windows sdk have support for filenames with unicode characters?
    The ExportRecord struct in PIExport.h has an attribute filename declared as char array.
    So I have a doubt whether filenames with unicode characters will be supported for export module.
    Thanks in advance,
    Senthil.

    SPPlatformFileSpecificationW is not available in ReadImageDocumentDesc.
    It has SPPlatformFileSpecification_t which is coming as null for export module.
    I am using phostoshop cs5 sdk for windows.
    Thanks,
    Senthil.

  • A PDF document with links to other PDFs corrupts the URL and get 404. Works in IE.

    One of our supplier sites has manuals online that are PDF docs with links from one to another. For example, when I click on "Tanaka" I get a PDF menu of Tanaka service manuals, etc. When I click on a section, such as "Chainsaw" I get a 404. Part of the directory structure in the URL is missing. For example when in the Tanaka PDF menu I click on Chainsaw I go to http://www.parklands.net/Resources/Tana%20CSaw%20Menu.pdf which is wrong. It should be http://www.parklands.net/Resources/Tanaka/Tana%20CSaw%20Menu.pdf, and in IE it is.
    == URL of affected sites ==
    http://

    The linked documents will not be automatically converted to PDFs and merged
    with your file, neither in Acrobat Standard nor in Acrobat Pro. You can do
    it, but you'll need to do it manually by converting all the files to PDFs,
    merging them and then adding the links between them.

  • CRVS2010 Beta - Cannot export report to PDF with unicode characters

    My report has some unicode data (Chinese), it can be previewed properly in the windows form report viewer. However, if I export the report document to PDF file, the unicode characters in exported file are all displayed as a square.
    In the version of Crystal Report 2008 R2, it can export the Chinese characters to PDF when I select a Chinese font in report. But VS2010 beta cannot export the Chinese characters even a Chinese font is selected.

    Barry, what is the specific font you are using?
    The below is a reformatted response from Program Management:
    Using non-Chinese font with Unicode characters (Chinese) the issue is reproducible when using Arial font in Unicode characters field. After changing the Unicode character to Simsun (A Chinese font named 宋体 in report), the problem is solved in Cortez and CR both.
    Ludek

  • How to set up a pdf embeded with different code so that people can get different excess code after they paid on-line?

    For example, I want to set up a pdf embeded with code, and send it on-line. People who want it should pay for it first and get the access code. I need to set different access code in order to avoid people A give the access to people B.

    Unless you use a very expensive DRM protection measure, I don't see how it's possible. How can you prevent someone from sending a file with the password to someone else?

  • Getting Runtime error while including pdf doc with Form guides.

    Hi,
    I have urgent requirement where  I have to capture  the data  in the PDF doc   what user enters into the  form Guides.
    I am trying this on ES2.
    I followed the steps what  they  mentioned at ::  http://help.adobe.com/en_US/livecycle/9.0/workbenchHelp/help.htm - >>Creating  Guides using LiveCycle  Workbench ES2 ->  Including the PDF doc with a document.
    They  mentioned that we have  to create form design (pdf) with same data  model.. But When i tries to create form design by  including the data  model ..  it is  not allowing to me  save as pdf and  its telling that we have to save as xdp only.   So saved as xdp only and followd all the same  steps what they  mentioned  ..  but we are getting error like  :::
    2010-01-07 17:13:08,227 ERROR [com.adobe.idp.workflow.dsc.invoker.WorkflowDSCInvoker] An exception was thrown with name com.adobe.repository.ResourceNotFoundException message: ALC-REP-018-000: Resource
    [/Form/SampleFormGuides/1.0/Form/MyInformation.xdp] does not exist or you do not have sufficient rights to access it. while invoking service RepositoryService and operation readResourceContent and no fault routes were found to be configured.
    Please find my  form guide setting  to invoke my  REST URL.. and my process.
    please  help  me  in this regard ,,,,,

    Hi Han,
    The  problem  might  be in path of the resources. Please check the  path  for the pdf you includes at form guide.
    Please check concat( ) operation  .. make sure that it is correct and pointing as per your work bench.
    And
    At Configuring the REST endpoint for the PDF render service:,   6th  point  , please select   as System level rather than INVOKE_PERM.
    I hope it helps.
    Thanks
    Praveen.

  • How to get the filename when parsing a file with d3l

    All
    After some time have experience with interconnect, IStudio I need the following info. Is it possible to get the filename when parsing a flat file using a d3l? This is needed because we need to store the filename together with the data into the database.
    Any examples or directions to some documents are welcome.
    Regards
    Olivier De Groef

    has anyone some info on this

  • Can not copy text from pdf with unicode font embedded.

    Hello,
    I have a pdf with unicode font embedded in it. The pdf has no restrictions. When i try to copy some text text fro m pdf and then paste itin word, the text is not the same which i copied from the pdf. it changes.
    I have tried multiple softwares which converts pdf to word or pdf to excel. but none can do my job. what should be the problem? Kindly guide me.
    Thanks & Regards-
    rashmi

    Thanks for your prompt reply.
    As i said i have the font installed on my system. for your reference,
    following is the link to the pdf file. also the second link is the link to
    the fonts used. Kindly help me to sort this issue.
    https://www.yousendit.com/download/T2dkcHBEVEh0QTIwYjhUQw
    https://www.yousendit.com/download/T2dkcHBFQXBrYUJYd3NUQw

Maybe you are looking for