function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Archana SarukArchana Saruk 

Attach/merge one PDF in other PDF

Hi we have requirement where we have to generate COF using visual force page  and attach/merge  documents attached under Notes/Attachment (Solution  Defenition document) section of opportunity . Here i want to know do we have any functionality in VF where we can attach PDFs to  COF PDF generated using visual force page

Ankit AroraAnkit Arora

Never tried though, but I think if you get the blob of PDF and put both in a single VFP then it may merge them both in a PDF. And it's very easy to attach PDF to notes and attachments (you will get plenty of help over this on-line)



Ankit Arora

Blog | Facebook | Blog Page


With PDF's, you can't simply merge blobs. I am not sure about combining the pages into one VF page but that seems like it would have some side effects including a shared heap limit - I could be wrong about this though.


Due to limitations of the salesforce platform, if you want a truly cloud based option you will need to use iText  (on a java platform like amazon web services) to combine the files and send your pdf back.


If you are willing to do this in a desktop application, please see my tool (written in java with iText) posted here.

Hengky IlawanHengky Ilawan

Hi Archana,


I was looking for a soluton for a similar situation and found this article, tought it might be useful to you.




Archana SarukArchana Saruk

Thanks for all of your replys , am trying to implement solution using iText. Will let you know in case i need more clarification or help.

Archana SarukArchana Saruk

Hi .. with the  approach mentioned in iText Tetorial , am able to merge PDF's.

But am calling


in javascript  as follows -


javascript: var pdfOverlay = QuotePDFPreview.quotePDFObjs['quotePDFOverlay'];

pdfOverlay.summlid = '0EHW000000008UQ';


//Webservice Call here
//rest of existing code as it is after this

pdfOverlay.dialog.buttonContents = '<input value=\"Save to Quote\" class=\"btn\" name=\"save\" onclick=\"QuotePDFPreview.getQuotePDFObject(\'quotePDFOverlay\').savePDF(\'0\',\'0\');\" title=\"Save to Quote\" type=\"button\" /><input value=\"Save and Email COF\" class=\"btn\" name=\"saveAndEmail\" onclick=\"QuotePDFPreview.getQuotePDFObject(\'quotePDFOverlay\').savePDF(\'1\');\" title=\"Save and Email Quote\" type=\"button\" /><input value=\"Cancel\" class=\"btn\" name=\"cancel\" onclick=\"QuotePDFPreview.getQuotePDFObject(\'quotePDFOverlay\').close();\" title=\"Cancel\" type=\"button\" />';





PDF created using above line , is messing -up header and contents .

I need to write above line to create Quote before calling Web Service ,so that in web-service call i can merge generated Quote and Solution Definion attachement added to opportunity. 


can anyone help me out here for this problem .






beco fuanbeco fuan
Here's a PDF merge guide ( that have sample code for combining and merge multiple PDF files into one.
Hope it can help you.
Hi Archana,

                 Have you resolved the issue? I have the same requirement. Can i get support from your side ?
sophian smithssophian smiths
With help of Merge PDF Tool application you can merge multiple PDF files.

Follow the steps given below:

1. Open the Merge PDF Tool application on the local machine

2. Go to File >> Create >> Combine Files into Single PDF

3. Click on the Add File option in order to combine PDF files

4. Choose the PDF files that you want to merge 

5. Click OK button to start the PDF Merging process

6. Then, preview all PDF files in the Merge PDF Tool Pro window

7. Choose the order of PDF files that has to be joined

8. Then, click on the Combine button

9- Save the PDF files by clicking  File >> Save As option

10- Select destination location for resultant PDF

However, if the user does not has the full version of Merge PDF Tool then, they can try Free PDF Merge Software. It is a free application to combine multiple PDF documents. Also, it is one of the top-rated utility to merge PDF documents moreover, the tool does not has limitation on the size and number of PDF files to be combined. visit:-
rishabh rathor 28rishabh rathor 28
With File ZIPO its possible to Merge Multiple Files & Documents into a PDF File which you can even download on desktop.
Here's the link -