PDFKit.AppendPages
------------------

Copies pages from one PDF to append other PDF.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [PDFKit](component_PDFKit.md) | [3.1](newinversion31.md) | ✅ Yes | ❌ No | ❌ No | ✅ Yes, on macOS | ✅ Yes |

MBS( "PDFKit.AppendPages"; PDFRef; OtherPDFs ) 

**MBS**( **"PDFKit.AppendPages";** /\* Copies pages from one PDF to append other PDF. \*/  
**$PDFRef**; /\* The PDF Reference where pages are added.e.g. $ref \*/   
**$OtherPDFs**) /\* Several PDF references. A container value with the PDF content from a media field. Or a text with an URL. Or a PDF reference from [PDFKit.Open](PDFKitOpen.md).e.g. $PDF \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| PDFRef | The PDF Reference where pages are added. | $ref |
| OtherPDFs | Several PDF references. A container value with the PDF content from a media field. Or a text with an URL. Or a PDF reference from [PDFKit.Open](PDFKitOpen.md). | $PDF |

### Result

Returns OK on success or error on failure.

### Description

Copies pages from one PDF to append other PDF.  
  
Your changes are only done in memory, so please remember to write modified pdf back to disk, e.g. by using [PDFKit.WriteToPath](PDFKitWriteToPath.md). Or use [PDFKit.GetPDFDocument](PDFKitGetPDFDocument.md) to get a PDF for storing in a container.  
### Examples

Merge two PDFs:

 Set Variable \[ $pdf ; Value: MBS ("[PDFKit.OpenContainer](PDFKitOpenContainer.md)"; MyTable::InputPDF ) \]   
Set Variable \[ $r ; Value: MBS ( "PDFKit.AppendPages"; $pdf ; MyTable::OtherPDF ) \]   
Set Field \[ MyTable::OutputPDF ; MBS ( "[PDFKit.GetPDFDocument](PDFKitGetPDFDocument.md)"; $PDF ) \]   
Set Variable \[ $r ; Value: MBS ( "[PDFKit.Release](PDFKitRelease.md)"; $pdf ) \]  
Loop over PDF documents in records and import them into a new PDF and add empty pages between:

 Go to Record/Request/Page \[ First \]  
Set Variable \[ $pdf ; Value: MBS ( "[PDFKit.NewPDFDocument](PDFKitNewPDFDocument.md)" ) \]   
Loop  
 Set Variable \[ $r ; Value: MBS ( "PDFKit.AppendPages"; $pdf ; Merge PDFs::InputPDF ) \]   
 Set Variable \[ $r ; Value: MBS ( "[PDFKit.AddEmptyPage](PDFKitAddEmptyPage.md)"; $pdf ; 700; 500) \]   
 Go to Record/Request/Page \[ Next ; Exit after last: On \]  
End Loop  
Set Field \[ Merge PDFs::FinalPDF ; MBS ("[PDFKit.GetPDFDocument](PDFKitGetPDFDocument.md)"; $pdf ) \]   
Set Variable \[ $r ; Value: MBS ("[PDFKit.Release](PDFKitRelease.md)"; $pdf ) \]  
### See also

- [PDFKit.AddEmptyPage](PDFKitAddEmptyPage.md)
- [PDFKit.GetPDFDocument](PDFKitGetPDFDocument.md)
- [PDFKit.NewPDFDocument](PDFKitNewPDFDocument.md)
- [PDFKit.Open](PDFKitOpen.md)
- [PDFKit.OpenContainer](PDFKitOpenContainer.md)
- [PDFKit.Release](PDFKitRelease.md)
- [PDFKit.WriteToPath](PDFKitWriteToPath.md)

### Blog Entries

- [PDFKit on iOS for MBS FileMaker Plugin](https://www.mbsplugins.de/archive/2017-11-30/PDFKit_on_iOS_for_MBS_FileMake/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin 3.1 for OS X/Windows - More than 1400 Functions In One Plugin](https://www.mbsplugins.de/archive/2013-02-12/MBS_FileMaker_Plugin_31_for_OS/monkeybreadsoftware_blog_filemaker)
- [MBS Filemaker Plugin, version 3.1pr8](https://www.mbsplugins.de/archive/2013-01-21/MBS_Filemaker_Plugin_version_3/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 18th August 2014 , last changed 28th September 2021

  
[PDFKit.AddImagePage](PDFKitAddImagePage.md) - [PDFKit.Combine](PDFKitCombine.md)

[HTML Version](PDFKitAppendPages.shtml)