Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copy a PDF to a new PDF

Status
Not open for further replies.

gfrlaser1

Technical User
Jan 31, 2013
28
US
This code works great for me to open a pdf however, what I want to do is not open it but have it saved as a new pdf. For instance when the operator chooses MYPDF from the form, it would not open it per se, rather it will copy it, create the temp.pdf and then open TEMP.PDF. I want to do this to preserve the templates from them changing anything on it. Is this doable?



#define SW_NORMAL 1
DECLARE LONG ShellExecute IN SHELL32.DLL ;
LONG nWinHandle, STRING cOperation,;
STRING cFileName, STRING cParameters,;
STRING cDirectory, INTEGER nShowWindow
ShellExecute(0, "open", "S:\shared files\bols\MYPDF.PDF", "", "", SW_NORMAL) && I want to copy and save as TEMP.PDF
 
simply beforehand

COPY FILE S:\shared files\bols\MYPDF.PDF TO c:\Temp\temp.pdf

then your code
#define SW_NORMAL 1
DECLARE LONG ShellExecute IN SHELL32.DLL ;
LONG nWinHandle, STRING cOperation,;
STRING cFileName, STRING cParameters,;
STRING cDirectory, INTEGER nShowWindow
ShellExecute(0, "open", " c:\Temp\temp.pdf", "", "", SW_NORMAL)

Bye, Olaf.
 
Thanks Olaf. I was sure there had to be a simple simple solution.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top