Files.ReadPDF
-------------

Reads a PDF file from the file system.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [Files](component_Files.md) | [4.3](newinversion43.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "Files.ReadPDF"; Path { ; FileName; DontRenderPreview } ) 

**MBS**( **"Files.ReadPDF";** /\* Reads a PDF file from the file system. \*/  
**$Path**; /\* The native file system path to the file.e.g. "/Users/cs/Desktop/test.pdf" \*/   
**$FileName**; /\* Optional; Optional the file name to use.e.g. "test.pdf" \*/   
**$DontRenderPreview**) /\* Optional; Pass 1 to not create a JPEG with preview of first page as part of the container.e.g. 0 \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| Path | The native file system path to the file. | "/Users/cs/Desktop/test.pdf" |  |
| FileName | Optional the file name to use. | "test.pdf" | Optional |
| DontRenderPreview | Pass 1 to not create a JPEG with preview of first page as part of the container. | 0 | Optional |

### Result

Returns container value or error.

### Description

Reads a PDF file from the file system.  
This function does not verify if the file you ask to load is actually a valid PDF.  
Reading files over 1 GB is not supported.  
  
See also [Files.ReadJPEG](FilesReadJPEG.md), [Files.ReadFile](FilesReadFile.md), [Files.ReadPNG](FilesReadPNG.md), [Text.ReadTextFile](TextReadTextFile.md) and [RichText.ReadFile](RichTextReadFile.md).  
  
If you have a DynaPDF Pro license and [DynaPDF](component_DynaPDF.md) functions initialized, this function can add previews for the PDF file on Windows and Linux. For MacOS, we make them with PDFKit.  
  
This function requires a native path. Use [Path.FileMakerPathToNativePath](PathFileMakerPathToNativePath.md) to convert a FileMaker path to a native path if required. If you like to have the user choose the path, you can use [FileDialog](component_FileDialog.md) functions.  
For Server be aware that server has limited permissions and may not be able to access all files on a computer.  
### Examples

Read a PDF file:

 Set Variable \[$r ; Value:MBS ( "Files.ReadPDF"; "/Users/cs/Desktop/todo.pdf")\]  
### See also

- [Container.ReadFile](ContainerReadFile.md)
- [Files.ReadFile](FilesReadFile.md)
- [Files.ReadJPEG](FilesReadJPEG.md)
- [Files.ReadPNG](FilesReadPNG.md)
- [Path.FileMakerPathToNativePath](PathFileMakerPathToNativePath.md)
- [RichText.ReadFile](RichTextReadFile.md)
- [Text.ReadTextFile](TextReadTextFile.md)
- [WebView.PrintToFile](WebViewPrintToFile.md)

### Example Databases

- [WebViewer/Custom WebView](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/WebViewer/Custom%20WebView.shtml#7ScriptAnchor_)

### Blog Entries

- [Printing a WebViewer in FileMaker](https://www.mbsplugins.de/archive/2024-02-16/Printing_a_WebViewer_in_FileMa/monkeybreadsoftware_blog_filemaker)
- [MBS Plugin Advent calendar: 12 - Files](https://www.mbsplugins.de/archive/2023-12-12/MBS_Plugin_Advent_calendar_12_/monkeybreadsoftware_blog_filemaker)
- [FileMaker 18 File Script Steps vs. BinaryFile functions](https://www.mbsplugins.de/archive/2019-06-03/FileMaker_18_File_Script_Steps/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 5.1pr1](https://www.mbsplugins.de/archive/2015-03-16/MBS_FileMaker_Plugin_version_5/monkeybreadsoftware_blog_filemaker)
- [MBS Filemaker Plugin, version 4.3pr4](https://www.mbsplugins.de/archive/2014-08-03/MBS_Filemaker_Plugin_version_4/monkeybreadsoftware_blog_filemaker)

### FileMaker Magazin

- [Ausgabe 3/2024, Seite 31](https://filemaker-magazin.de/neuigkeit/4263-Appetithappen-FMM_202403)

This function is free to use.

Created 18th August 2014 , last changed 4th August 2023

  
[Files.ReadJPEG](FilesReadJPEG.md) - [Files.ReadPNG](FilesReadPNG.md)

[HTML Version](FilesReadPDF.shtml)