How to Merge Multiple PDF's
HI Forum
I am a newbie to both Acrobat and VB,
Basically a perl Developer,
I have created a application to Merge multiple PDF's into a Single PDF, but the problem I am facing is some pages are missed during Merging
For Example
I have 4 pdf's (1.pdf, 2.pdf, 3.pdf, 4.pdf), each PDF has 2 pages, totally 8 pages,
When i merge using my application, it is getting collapsed and then merged
Here is my Code
<code>
Imports System.IO
Imports Acrobat
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
MergePDF()
End Sub
Sub MergePDF()
Dim gPDDoc1 As AcroPDDoc
Dim gPDDoc2 As AcroPDDoc
Dim gPDDoc3 As AcroPDDoc
Dim gPDDoc4 As AcroPDDoc
gPDDoc1 = CreateObject("AcroExch.PDDoc")
gPDDoc2 = CreateObject("AcroExch.PDDoc")
gPDDoc3 = CreateObject("AcroExch.PDDoc")
gPDDoc4 = CreateObject("AcroExch.PDDoc")
Dim chk1 = gPDDoc1.Open("D:\sathish\1.pdf")
Dim chk2 = gPDDoc2.Open("D:\sathish\2.pdf")
Dim chk3 = gPDDoc3.Open("D:\sathish\3.pdf")
Dim chk4 = gPDDoc4.Open("D:\sathish\4.pdf")
Dim mergefile As Boolean
Dim numpg1, numpg2, numpg3, numpg4
numpg1 = gPDDoc1.GetNumPages()
numpg2 = gPDDoc2.GetNumPages()
numpg3 = gPDDoc3.GetNumPages()
numpg4 = gPDDoc4.GetNumPages()
MsgBox(numpg1 & numpg2 & numpg3 & numpg4)
mergefile = gPDDoc1.InsertPages(numpg1 - 1, gPDDoc2, 0, 1, 0)
mergefile = gPDDoc1.InsertPages(numpg2 - 1, gPDDoc3, 0, 1, 0)
mergefile = gPDDoc1.InsertPages(numpg3 - 1, gPDDoc4, 0, 1, 0)
Dim savemergefile As Boolean
savemergefile = gPDDoc1.Save(1, "D:\sathish\merged.pdf")
End Sub
End Class
</code>
I Dont know how to give the correct page end to merge,
Thanks in Advance for your Kind replies,
Thanks & Regards
Sathish V.
Great idea. do you have example code? I found some code but it its contingent upon the pages having a page number on them. the pdfs im dealing with have no page numbers on the pages. also this code deletes pages in a range. I need to delete all other pages except for the page numbers on the range. thanks! Option Explicit Sub Delete_PDF_Pages() ' Adobe code based on http://vbcity.com/forums/t/51200.aspx Dim xMsg As String Dim xInput As String Dim xOutput As String Dim xResponse As Long Dim xLast_Row As Long Dim xErrors As Long Dim xDeleted As Long Dim i As Long Dim j As Long Dim AcroApp As CAcroApp Dim AcroPDDoc As CAcroPDDoc Dim AcroHiliteList As CAcroHiliteList Dim AcroTextSelect As CAcroPDTextSelect Dim xarray() As Variant Dim PageNumber As Variant Dim PageContent As Variant Dim xContent As Variant xInput = "C:\Users\jaime\Desktop\Granado LLC\test\TestPages.pdf" xOutput = "C:\Users\jaime\Desktop\Granado LLC\test\TestPages_Output.pdf" xLast_Row = [A1].SpecialCells(xlLastCell).Row ReDim xarray(xLast_Row) xResponse = MsgBox("About to delete all pages which contain values from the range A1:A" & xLast_Row & Chr(10) _ & Chr(10) & "Input:" & Chr(9) & xInput _ & Chr(10) & "Output:" & Chr(9) & xOutput _ & Chr(10) & Chr(10) & "('OK' to continue, 'Cancel' to quit.)", vbOKCancel, "Delete Pages") If xResponse = 2 Then MsgBox "User chose not to continue. Run terminated." Exit Sub End If ' Files and data OK? If Dir(xInput) = "" Then xMsg = "Input file not found - " & xInput & Chr(10) If Dir(xOutput) <> "" Then xMsg = "Output file exists - " & xOutput & Chr(10) xarray = Application.Transpose(Range("A1:A" & xLast_Row)) For i = 1 To xLast_Row If Not IsNumeric(xarray(i)) Or xarray(i) = "" Then xMsg = "Non-numeric ""Delete"" value of """ & xarray(i) & """ found on row " & i & Chr(10) Exit For End If Next If xMsg <> "" Then MsgBox (xMsg & Chr(10) & "Run cancelled.") Exit Sub End If ' Open the PDF... Set AcroApp = CreateObject("AcroExch.App") Set AcroPDDoc = CreateObject("AcroExch.PDDoc") If AcroPDDoc.Open(xInput) <> True Then MsgBox (xInput & " couldn't be opened - run cancelled.") Exit Sub End If ' Read each page... For i = AcroPDDoc.GetNumPages - 1 To 0 Step -1 Set PageNumber = AcroPDDoc.AcquirePage(i) Set PageContent = CreateObject("AcroExch.HiliteList") 'Get up to 9,999 words from page... If PageContent.Add(0, 9999) <> True Then Debug.Print "Add Error on Page " & i + 1 xErrors = xErrors + 1 Else Set AcroTextSelect = PageNumber.CreatePageHilite(PageContent) If Not AcroTextSelect Is Nothing Then xContent = "" For j = 0 To AcroTextSelect.GetNumText - 1 xContent = xContent & AcroTextSelect.GetText(j) Next j For j = 1 To xLast_Row If InStr(1, xContent, xarray(j)) > 0 Then Debug.Print "Page " & i + 1 & " contains " & xarray(j) & " - " & xContent ' To avoid problems with the delete... Set AcroTextSelect = Nothing Set PageContent = Nothing Set PageNumber = Nothing If AcroPDDoc.DeletePages(i, i) = False Then MsgBox ("Error deleting page " & i + 1 & " - run cancelled.") Exit Sub End If xDeleted = xDeleted + 1 Exit For End If Next End If End If Next i If AcroPDDoc.Save(PDSaveFull, xOutput) = False Then MsgBox "Cannot save the modified document" Exit Sub Else MsgBox (xDeleted & " pages deleted. (" & xErrors & " errors.)") End If AcroPDDoc.Close AcroApp.Exit End Sub
Similar Messages
-
How to merge multiple PDFs and display in a new window
Hi,
I'm trying to merge multiple PDFs into one PDF and display the output in a new window using PeopleCode. I have a button on a page, which when clicked should open a new window with the merged PDFs. I am able to succussfully merge the PDFs using the PDFmerger class (mergePDFs) but unable to display the result in a new window.
Please help.Thanks.
I also found this piece of code very helpful.
Local PSXP_RPTDEFNMANAGER:Utility &oUtil;
Local boolean &bRtn;
/* send the output to client */
/* &sFileName = the file path /file_name.extension */
&oUtil = create PSXP_RPTDEFNMANAGER:Utility();
&bRtn = &oUtil.zipAndViewAttachment(&sFileName);
Edited by: user8260115 on Sep 9, 2009 4:57 PM -
Merge multiple pdf files into single pdf
How to merge multiple pdf files into single pdf file through any programmatic languages? Kindly share with me.
ThanksEasy PDF
http://www.macupdate.com/app/mac/38090/easy-pdf
How To: Combine multiple PDFs in Preview
http://macenstein.com/default/2011/12/how-to-combine-multiple-pdfs-in-preview/
How to merge pdf files in OSX
http://macintoshhowto.com/leopard/how-to-merge-pdf-files-with-preview-in-leopard .html
How to Combine Multiple PDFs Using Preview
http://www.macobserver.com/tmo/article/how_to_combine_multiple_pdfs_using_previe w/ -
How to merge multiple PDF files with its corresponding review comments and stamps, which has stored as FDF files in WebDAV server?
Bring each FDF file into a corresponding PDF.
Use Acrobat to merge the PDF files into a new, separate PDF.
Be well... -
How do you merge multiple pdf's into one document?
How do you merge multiple pdf's into one document?
Hi pharmovative,
You can use the Combine PDF feature of Adobe PDF pack to combine multiple PDF files into one document. (Or, if you have the full version of Acrobat, you an do it there as well by choosing Create > Combine Files into a Single PDF.)
Please let us know if you need further assistance.
Best,
Sara -
How do I merge multiple pdf documents into 1 with my iPad ?
How do I merge multiple pdf documents into 1 with my iPad ? We are required by our customer 1 document that includes 4 different documents from different departments. Currently with our PC we can merge PDF files, excel or word files in to 1 PDF document. How can I do the same with our iPads and iPad minis using adobe?
blogs.adobe.com We are excited to announce that Adobe CreatePDF application is now available on iOS. With this, Adobe brings rich, high-fidelity and Acrobat-like PDF creation to the iOS devices. You can now convert all your documents on iPad, iPhone & iPod touch devices to PDF for reliable, secure sharing and viewing across PCs, tablets & Smartphones.
Robert Monsalve
[signature removed by host] -
How to Merge 1 PDF file to 50 PDF together not one by one. Using Acrobat 9 Windows xp.
Hi, How to Merge 1 PDF file to 50 PDF together not one by one. Using Acrobat 9 Windows xp.
Depending on just what you are trying to do, you can also use DOCUMENT>Insert Pages to add multiple documents or simply drag and drop the documents into the current document (OK, I have not tried this one).
-
Text issues merging multiple pdfs into one pdf
Hello, when I merge multiple pdfs into one pdf document my text is missing or garbled. I spent hours yesterday trying to figure this out, from insuring the text was embedded and print setting were correct. Please help!!
Using Adobe Pro 9.0
Thanks,
FaithAcrobat Pro is the application you use for working with PDFs, making minor edits, combining multiple PDFs into a single file, extracting or replacing pages, doing fancier form work than ID has the ability to produce, and even creating PDF from a number of other file formats. I'm not sure your question about maintaining the quality of your photos is really applicable -- it would depend on how youare getting from the photo to PDF to begin with. The use of Acrobat in and of itself won't be the determiner.
That said, I couldn't live without Acrobat Pro in my workflow. Since you are on CS5.5 you have a couple of options. You could purchase a subscription to Creative Cloud (at a discount for the first year), which would give you access not only to Acrobat, but all of the other programs and tools included in the suite, but you pay a monthly or yearly fee, or you can buy a standalone perpetual license to either Acrobat Pro or Acrobat Standard (I didn't realize Standard was still an option, and you might not need all the features of Pro -- you can compare at http://www.adobe.com/products/acrobatpro/buying-guide.html). -
When merging multiple pdf into one all pages are blank
I am currently using Adobe Acrobat Version 10.1.13. When I try to merge multiple pdf's into one all pages are blank. I ran the Repair Adobe Installation and this did not fix the problem.
Please provide me with any help/suggestions you may have.
thank you in advance for your time.Hey tricon5757,
Could you please let me know how have you tried merging PDFs.
Also, try choosing 'Document > Insert Pages' option and combine PDF one after the other.
Let me know if this works.
Regards,
Anubha -
Merging Multiple PDF Files in C# using Acrobat 7.0
I'm trying to merge multiple pdf files into one pdf file. Does anyone have sample or psuedo code for this?
Basicly, there has not much changed since version 5 so you can use also vers. 8 SDK / IAC section.
The command you to use is "insert", where the first page has to be opened and the other pages will be inserted.
If you google for PdDoc.insert you may get tons of examples and maybe also in C.
If you use Acro-Javascript via IAC you may find an example direct in the AcroJs helpfile.
HTH, Reinhard -
I have a paid subscription, but am no longer able to merger multiple pdf documents into one pdf. What's up?
Pat:
Below is a copy of an 8/7/2013 email from adobe. I prepaid a one-year subscription, and, until I recently upgraded to Windows 8, I was able to make several dozens of merged pdf documents. I seem to be no longer able to use the merge feature that I had successfully and repeated used. When I search for the merge feature I end up with a request that I pay for an upgrade monthly subscription to use the merge feature.
Tom
=================================here follows my subscription email====================================================
Welcome to Adobe ExportPDF
2 messages
[email protected] <[email protected]>
Wed, Aug 7, 2013 at 1:01 PM
Reply-To: [email protected]
To: [email protected]
Dear Thomas Corr,
Thank you for purchasing a subscription for Adobe ExportPDF.
Sign-in to export a PDF Now >>
With your subscription you can:
Enjoy unlimited online conversions from PDF to Word (DOCX).
Make scanned text editable.
Maintain page, paragraph, and font attributes.
Preserve tables, images, and multi-column text.
Export PDF comments to Word.
Help and feedback
Get help from Adobe on the Support Center.
The Adobe ExportPDF Team -
How to genarate multiple pdf's in XML Publisher
Hi,
i need sample code for genarating multiple pdf output files.
I am using datasource as "XML file" & Through Application Engine ..
How to genarate multiple pdf's..
Please any one help on this issue, and also send me sample code step by step process
Regards
RaviHi,
Please refer to the setup/config of Bursting option for the XMLp report.
Thanks,
Saxon SI -
Merging multiple pdf files not available
I want to merge multiple PDF files into one PDF file. I used to be able to do it under file>create pdf, but ever since my computer was re-built, that option is no longer under the file tab. Was this something extra that you had to pay for, or do I have to do something to get this add in. Thank you in advance
Yeah you need one of the acrobat family. To be specific, Acrobat Standard, Acrobat 9 Pro or Acrobat Extended
They have 30 day trial on adobe.com. But check first the system requirements so that it won't mess up your computer. -
I'm trying to organize my PDFs in iBooks on my ipad2 and can't figure out how to combine multiple PDFs into one. Any thoughts?
I'm trying to organize my PDFs in iBooks on my ipad2 and can't figure out how to combine multiple PDFs into one. Any thoughts?
-
How to merge multiple spools in one PDF
hi all,
i have a requirement to merge multiple spools into one PDF.
I have the code to merge 2 spools into one PDF but acc to my requirement this number can be any( say 100). hence i need help to merge N number of spools in one PDF.
Regards
geeta guptaTake the data of all spools into a internal table then create a new spool with this data then downlad this data into pdf format.
By this method you can download any number of spools into a single pdf file. Please see the below code
Fetch spool number
Select rqident from tsp01 into table g_t_data
where...............
Read sool data and take this data into a internal table
Loop at g_t_data.
Call program to read spool as follows
SUBMIT rspolst2 EXPORTING LIST TO MEMORY AND RETURN
WITH rqident = g_t_data-rqident
WITH first = '1'
Read memory where spool data is stored
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = mem_tab
Convert spool data to Ascii
IF NOT mem_tab[] IS INITIAL.
CALL FUNCTION 'LIST_TO_ASCI'
EXPORTING
list_index = -1
TABLES
listasci = g_t_text1(table type c length 10000)
listobject = mem_tab(LIKE TABLE OF abaplist)
APPEND LINES OF g_t_text1 TO g_t_text.
ENDIF.
ENDLOOP.
Create new spool with internal table data
NEW-PAGE PRINT ON
KEEP IN SPOOL l_keep(variable type c default u2018Xu2019)
LINE-SIZE 300
LIST NAME l_list (variable(30) TYPE c default 'combined_pdf')
NO DIALOG.
LOOP AT g_t_text.
WRITE: g_t_text-data.
ENDLOOP.
NEW-PAGE PRINT OFF.
COMMIT WORK.
Fetch this spool number from TSP01
SELECT rqident rqcretime FROM tsp01 INTO TABLE l_t_pdf(internal table having two fields rqident LIKE tsp01-rqident and rqcretime LIKE tsp01-rqcretime)
WHERE rqowner = sy-uname AND
rq2name = 'COMBINED_PDF'.
Download spool data into pdf format
CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
EXPORTING
src_spoolid = l_t_pdf-rqident
IMPORTING
pdf_bytecount = l_size(variable type i)
TABLES
pdf = g_pdf(table like table of tline)
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
bin_filesize = l_size "size
filename = l_data
filetype = 'BIN'
TABLES
data_tab = g_pdf.
Hope this will help you.
Maybe you are looking for
-
Second-hand phone reactivation without owner's ID and password
I really am disappointed because I bought a second-hand iPhone 4s and my friend formatted the phone. It needs the previous owner's ID and password. I already contacted the owner but it was a long time ago that he purchased the phone. He forgot everyt
-
TS3212 can the new itunes load on a powerbook g4 using osx 10.5.8
can the new itunes load on a powerbook g4 using osx 10.5.8
-
PoS DM 3.1 BI content 3.3
Hi all, What is the diffrence in POS DM in BW 3.1 and BW release 3.5 and how the POS workbench work. any ideas will higly appreciate. Thanks Qandeel
-
Hello When we try to connect to a company, we get the following message: License Error -2147023174 Server RPC not available. Somebody have any idea about how to solve this? Regards,
-
I am having trouble upgrading the firmware on my WRE54G. My hardware is v.3 and the existing firmware is 3.01.01. I downloaded the latest firmware and extracted the .img file. I went to the admin page of the expander, pointed it towards the new firmw