You are a programmer so creating your own code is your job.
This will work for any file. Try to understand it and adapt to your own needs.
Must work with binary file for reading and writing. CStdioFile is text by default.
#include <iostream>
#include <fstream>
#include <conio.h>
using namespace std;
int main () {
ifstream::pos_type fSize = 0;
char * memblock = NULL;
ifstream fileIn ("c:\\Temp\\example.pdf", ios::in|ios::binary|ios::ate);
if (fileIn.is_open())
{
fSize = fileIn.tellg();
memblock = new char [fSize]; fileIn.seekg (0, ios::beg);
fileIn.read (memblock, fSize);
fileIn.close();
cout << "The input file is in memory.\n";
ofstream fileOut ("c:\\Temp\\example2.pdf", ios::out|ios::binary|ios::ate);
if (fileOut.is_open())
{
fileOut.write(memblock, fSize);
fileOut.close();
cout << "The new file has been created.\n";
}
else cout << "Unable to open output file.\n";
}
else cout << "Unable to open input file.\n";
_getch();
if(memblock)
delete[] memblock;
return 0;
}