I would do a form in the previous screen with all the possible PDF files to be included, make one checkbox for each PDF available, and name it with the same name, let's say "pdf", but the value of each one would be the name of the file, example:
Code:
<body>
<form name="form1">
<input type="checkbox" name="pdfs" value="c:\file1.pdf">This is PDF 1<br>
<input type="checkbox" name="pdfs" value="c:\file2.pdf">This is PDF 2<br>
<input type="checkbox" name="pdfs" value="c:\file3.pdf">This is PDF 3<br>
<input type="checkbox" name="pdfs" value="c:\file4.pdf">This is PDF 4<br>
<input type="checkbox" name="pdfs" value="c:\file5.pdf">This is PDF 5
</form>
</body>
What browsers do is join, sepparated by commas every form element with the same name, so the POST of this form to the next page, which would be your ASP code will get from the "pdfs" checkbox is "c:\file1.pdf, c:\file2.pdf, c:\file3.pdf, c:\file4.pdf, c:\file5.pdf"
Now, before the Convert thing, you simply have to split (with the split function) the entire string into small strings sepparated by commas. The only LOOP you have to do now is a FOR / NEXT, getting every filename, one by one, example:
Code:
filenames = Split(Request.Form("pdfs"), ",")
maxfiles = Ubound(filenames)
For thisfile = 0 to maxfiles
totalfiles = filenames(thisfile) & Chr(13)
Next
Set C=CreateObject("Combine.Combine")
C.Convert totalfiles, "c:\dest.pdf", ""
Maybe the code needs a little fix, I don't know how the Combine component works at all! Let me know if it works. Regards! Diego.
Bookmarks