QLPreviewPanel.AddPDF
---------------------

Adds a PDF to the preview items.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [QuickLook](component_QuickLook.md) | [4.3](newinversion43.md) | ✅ Yes | ❌ No | ❌ No | ❌ No | ✅ Yes |

MBS( "QLPreviewPanel.AddPDF"; PDF { ; Title } ) 

**MBS**( **"QLPreviewPanel.AddPDF";** /\* Adds a PDF to the preview items. \*/  
**$PDF**; /\* The PDF. \*/   
**$Title**) /\* Optional; The title to use.e.g. "Hello World" \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| PDF | The PDF. | $pdf |  |
| Title | The title to use. | "Hello World" | Optional |

### Result

Returns OK or error.

### Description

Adds a PDF to the preview items.  
You can pass 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).  
  
Either we use file path from FileMaker's external container storage directly or we write a temporary file, which is cleared later when app quits or panel is cleared.  
### See also

- [PDFKit.Open](PDFKitOpen.md)
- [QLPreviewPanel.AddFile](QLPreviewPanelAddFile.md)
- [QLPreviewPanel.AddImage](QLPreviewPanelAddImage.md)
- [QLPreviewPanel.Clear](QLPreviewPanelClear.md)
- [QLPreviewPanel.GetTop](QLPreviewPanelGetTop.md)
- [QLPreviewPanel.Hide](QLPreviewPanelHide.md)
- [QLPreviewPanel.Resize](QLPreviewPanelResize.md)
- [QLPreviewPanel.Show](QLPreviewPanelShow.md)

### Release notes

- **Version 12.4**
    - Changed [QLPreviewPanel.AddPDF](https://www.mbsplugins.eu/QLPreviewPanelAddPDF.shtml) to pass right filename of PDF from container to the preview window.

### Example Databases

- [Mac only/Icon and QuickLook/QuickLook Preview Panel](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Mac%20only/Icon%20and%20QuickLook/QuickLook%20Preview%20Panel.shtml#1ScriptAnchor_)

### Blog Entries

- [MBS FileMaker Plugin, version 12.4pr1](https://www.mbsplugins.de/archive/2022-08-01/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 18th August 2014 , last changed 15th August 2018

  
[QLPreviewPanel.AddImage](QLPreviewPanelAddImage.md) - [QLPreviewPanel.Clear](QLPreviewPanelClear.md)

[HTML Version](QLPreviewPanelAddPDF.shtml)