Ask a Question related to Adobe Acrobat SDK, Design and Development.
-
palaksha@adobeforums.com #1
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
-
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... -
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... -
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:... -
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... -
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... -
Polda@adobeforums.com #2
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
-
palaksha@adobeforums.com #3
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
-
Leonard_Rosenthol@adobeforums.com #4
Re: Problem with file path.
Have you traced into the code and watched the values in the debugger?
Leonard_Rosenthol@adobeforums.com Guest
-
palaksha@adobeforums.com #5
Re: Problem with file path.
Yes Leonard i checked that, am getting correct values(correct pathname) during debugging.
palaksha@adobeforums.com Guest
-
Aandi_Inston@adobeforums.com #6
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
-
palaksha@adobeforums.com #7
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



Reply With Quote

