INTELLIGENT WORK FORUMS FOR COMPUTER PROFESSIONALS
Come Join Us!
- Talk With Other Members
- Be Notified Of Responses
To Your Posts
- Keyword Search
- One-Click Access To Your
Favorite Forums
- Automated Signatures
On Your Posts
- Best Of All, It's Free!
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.
Partner With Us!
"Best Of Breed" Forums Add Stickiness To Your Site

(Download This Button Today!)
Member Feedback
"...I wish I knew about this site years ago. It would have saved me a lot of heartaches..."
Geography
Where in the world do Tek-Tips members come from?
|
Merge two or more pdf documents into one
|
|
|
amutinu (Programmer) |
18 Nov 01 16:17 |
Hello All, I have a web page where users can select multiple check boxes (where each checkbox is a pdf document link) and i want to be able to merge the selected document into so that i can print multiple copies collately. I would really appreciate it if someone can provide with the sample code or maybe guide me in the right direction.
thanks, |
|
if you have say two saved pdf files, you can combine them together using adobe full version application by [1] open one pdf file [2] with adobe select document\insert pages [3] open the 2nd file [4] save the current file into a new pdf file
hope this helps |
|
|
amutinu (Programmer) |
26 Nov 01 10:24 |
Hi sncheong, thanks for your feedback but i was looking more in terms of merging the two pdf documents using ASP or VB. I am trying to write a program that will merge two documents that are on the web server and then print them.
Let me know if you have any suggestions for this,
thanks, |
|
|
calin98 (Visitor) |
8 Jan 02 14:51 |
Hello, Do you happen to know the ASP code (vbscript) to put a PDF document link on a web page? I would appreciate it your reply. Thank you. |
|
|
zgrande (Programmer) |
18 Mar 02 8:37 |
If you are using VB, references de "Acrobat Type Lybrary" in you project, then add an CAcroApp object, this is the Acrobat application class. Use this Object do open the two files to be merged, in the first document use the method "InsertPages" to add the second file. Now just save the document. For more information go to www.planetpdf.com, they have an VB6 example, it's not complete, but it will be helpful. |
|
This information may be of help to some of your questions. Of course its all previous postings so you will have to dig out what you want. Thre is a October 18, 2000 post entitled "Acrobat Automation is there such a thing", and there is also a Sept 12,2001 post entitled "Merging/Appending Pages to PDF".
I have been looking for a solution that would also allow me to insert pages programmatically. I find that Adobe allows you do specify a folder of Pdf documents and then it will merge these for you; however the order gets all jumbled up. Our needs require that these documents are inserted in the order that we specify. I have found some useful information in those documents. In the meantime, if you know of anything that might be helpful for us, please let me know.
Thanks,
GM |
|
|
NebA (TechnicalUser) |
21 Mar 02 11:11 |
Acrobat will insert the pages in the same order that they are selected. (ex. If you select a group of files by dragging a window from right to left, it will insert the files starting with the file that is furthest to the right, and vice versa.) If you can figure out a way to control what order it selects the files in a folder, then that should solve your problem. |
|
Hi amutinu,
If you're still interested...
I was asked to combine two or more PDF files myself recently (prior to E-mailing the resulting PDF). had to do this quickly (deadline) but it works.
cFiles is just a collection of filenames in the order I want the PDF files to be combined. You'll have to set a references to the Acrobat Type library but you might already know that.
Private Sub Combine(ByVal cFiles As Collection) Dim i As Long Dim oPDF As Acrobat.CAcroPDDoc Dim oTemp As Acrobat.CAcroPDDoc Dim sDir As String Dim nPagesTo As Long Dim nPagesFrom As Long On Error GoTo ERRHANDLER sDir = File1.Path If Right$(sDir, 1) <> "\" Then sDir = sDir & "\" Set oPDF = CreateObject("AcroExch.PDDoc") If Not oPDF.Open(sDir & cFiles(1)) Then Err.Raise vbObjectError + 1001, "Combine", "Unable to open " & cFiles(1) End If nPagesTo = oPDF.GetNumPages For i = 2 To cFiles.Count Set oTemp = CreateObject("AcroExch.PDDoc") If Not oTemp.Open(sDir & cFiles(i)) Then Err.Raise vbObjectError + 1001, "Combine", "Unable to open " & cFiles(i) End If nPagesFrom = oTemp.GetNumPages If Not oPDF.InsertPages(nPagesTo - 1, oTemp, 0, nPagesFrom, True) Then Err.Raise vbObjectError + 1001, "Combine", "Unable to add " & cFiles(i) End If nPagesTo = oPDF.GetNumPages Next i If Not oPDF.Save(PDSaveFull, sDir & Text1.Text) Then Err.Raise vbObjectError + 1001, "Combine", "Unable to save " & Text1.Text End If Set oPDF = Nothing Exit Sub ERRHANDLER: MsgBox Err.Description & vbCrLf & _ Err.Source, vbExclamation Set oPDF = Nothing Set oTemp = Nothing End Sub
|
|
|
gjpyne (IS/IT--Management) |
3 Apr 02 14:29 |
|
|
masonf (IS/IT--Management) |
28 Jun 02 12:10 |
I need to be able to take a dynamically created PDF and append a 10-page PDF to the end of it to be displayed in a browser.
Is this possible in ASP? Is the full version of Acrobat need to be installed on the web server or is there more that has to be installed for this to work?
Thnaks. |
|
|
 |
|