Problem with file path.

Ask a Question related to Adobe Acrobat SDK, Design and Development.

  1. #1

    Default Problem with file path.

    Hi,

    I have a plug-in implemented on visual C++ platform, in that I am creating backup file for PDF to be processed before applying any changes, am using following code to create backup.
    CString csSourcefile, csDestfile;
    PDDoc Dest_doc = PDDocCreate();
    ASPathName asPath= ASPathFromPlatformPath(&buf);
    PDDoc Source_doc = PDDocOpen( asPath, ASGetDefaultFileSys(), NULL,TRUE);
    PDDocInsertPages(Dest_doc, PDBeforeFirstPage ,Source_doc,0,PDDocGetNumPages(Source_doc), PDInsertBookmarks, NULL, NULL, NULL,NULL);

    csDestfile = “E:\Some_folder\somefilename.pdf”;
    ASPathName asDestPath=ASFileSysCreatePathName(ASGetDefaultFil eSys(),ASAtomFromString("Cstring"), csDestfile, NULL);
    PDDocSave(pdNewDoc,PDSaveFull, asDestPath,NULL,NULL,NULL);
    PDDocClose (pdNewDoc);

    It is working fine and creating backup file in the corresponding folder.
    The same above code now I am using in another plug-in, that I am implementing on Visual studio .Net/C++ platform(Acrobat sdk 7.0).
    But it is not creating the backup file in the correct folder, but creating some unknown file format on the desktop with filename having only one char. Eg. For the above destfile(E:\Some_folder\somefilename.pdf)
    a unknown file type with name “E” is created on desktop. If I give .pdf extension to the above file, actually it is the backup file that I have to create, but with wrong pathname/filename. Why it is creating problem on .Net platform, and not creating with correct pathname/filename.
    Can anybody tell me?
    palaksha@adobeforums.com Guest

  2. Similar Questions and Discussions

    1. Please Advice. What´s the right path? plain file vs xml file
      Hello Everybody! I´d like that you give me some advice on what the right approach to import some data from one system to another is. I know that...
    2. File Path Length Problem
      I receive an error whenever the file path of an Acrobat file exceeds 119 characters. I am using Acrobat 6.0.1 Pro. The error indicates "the...
    3. file path pattern matching problem.
      Hi all, I'm trying to split apart a filepath...e.g: c:\test\abc\what\somefile.txt The length of the filepath will never be constant... e.g:...
    4. URL from File Path Name
      I know there must be a function somewhere for converting a local file path name to the url path (i.e. /user/apache/htdocs/myDir/myFile.jpg to...
    5. File Path
      I was trying to use the ftp_put command. It worked for the files in the same directory as my php file, but if I try to fetch a file somewhere else...
  3. #2

    Default Re: Problem with file path.

    I'd say you need to use double \ in file path

    csDestfile = “E:\\Some_folder\\somefilename.pdf”;

    polda
    Polda@adobeforums.com Guest

  4. #3

    Default Re: Problem with file path.

    Sry,
    I used correct path in coding. I mean "E:\\Some_folder\\somefilename.pdf" itself in coding. and it worked on visual C++ envoirnmentm, am getting problem only on .Net/C++ envoirnment.
    palaksha@adobeforums.com Guest

  5. #4

    Default Re: Problem with file path.

    Have you traced into the code and watched the values in the debugger?
    Leonard_Rosenthol@adobeforums.com Guest

  6. #5

    Default Re: Problem with file path.

    Yes Leonard i checked that, am getting correct values(correct pathname) during debugging.
    palaksha@adobeforums.com Guest

  7. #6

    Default Re: Problem with file path.

    There are some APIs for returning the text equivalent of an
    ASPathName. It is probably worth trying these on asDestPath to see
    what they think the value is.

    Aandi Inston
    Aandi_Inston@adobeforums.com Guest

  8. #7

    Default Re: Problem with file path.

    Yes Aandi, i checked using
    char* Name = ASFileSysDisplayStringFromPath(ASGetDefaultFileSys (), asDestPath);
    suppose original file is
    sourceFile = “E:\\Some_folder\\somefilename.pdf”;
    then i want to creat backup in the folder
    csDestfile = “E:\\Some_folder\\Backup_folder\\somefilename.pdf” ;
    and my project folder is, say
    "D:\\Main_folder\\Application_Folder",
    then during debugging am getting pathname for backup file (obtained from ASFileSysDisplayStringFromPath) as "D:\\Main_folder\\Application_Folder\\E", which is supposed to be
    “E:\\Some_folder\\Backup_folder\\somefilename.pdf” ; ,
    am not getting where the problem is. In my first post, i given the code implemented. please tell me what's wrong with it.
    palaksha@adobeforums.com Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139