I am placing data/text on seperate individual pdf document and creating new pdf output documents. I am now trying to combine all of those new ouput pdf documents into one pdf document so i can then open the entire print job for viewing an print.
can wppdfprinter do this? It looks like wppdfexport can but i don't have that tool. Is there a command line tool that could be used to comine all pdf's in a given directory?
below is my failed code but will give a better idea of what i am trying to do.
Thanks for any help
//combine all .OUT pdf files and then ask to display
TWPPDFPrinter *pdf=new TWPPDFPrinter(Application);
AnsiString sOutputFile;
AnsiString sInputFile;
AnsiString sTempPath=FMain->User->asUser[173];//pdf archive path
if (sTempPath=="")
sTempPath=FMain->sDataPath;
sOutputFile=sTempPath + "VTSTATE_"+FMain->Client->sTPLast +"_"+FMain->Client->sID+".PDF";
pdf->Filename=sOutputFile;
pdf->BeginDoc();
AnsiString sFileSpec = FMain->sProgramPath+"LVT*.OUT";
AnsiString sSource,sDest;
HANDLE hFind;
LPWIN32_FIND_DATA lpFindFileData = new WIN32_FIND_DATA;
bool bFound=false;
hFind = FindFirstFile(sFileSpec.c_str(),lpFindFileData);
if (hFind!=INVALID_HANDLE_VALUE)
bFound = true;
AnsiString sFile;
int iPages=0;
while (bFound)
{
sFile=FMain->sProgramPath+lpFindFileData->cFileName;
pdf->InputFile=sInputFile;
//pdf->Print();
bFound = FindNextFile(hFind,lpFindFileData);
iPages++;
pdf->EndPage();
}
pdf->EndDoc();
delete lpFindFileData;
delete pdf;
ShowMessage(FormatFloat("0",iPages) + " page PDF created in " + sOutputFile);