> ## Documentation Index
> Fetch the complete documentation index at: https://cloudinary.com/documentation/llms.txt
> Use this file to discover all available pages before exploring further.

# Create PDF files from images


You can create a PDF file from images stored in your Cloudinary storage.  Identify the images you want to include in the PDF by applying the same tag to each of the images.  In the resulting PDF, they are ordered alphabetically by public ID with a page per image.

> **INFO**:
>
> To reduce the chances of malware or other potentially harmful files being distributed via the Cloudinary domain, PDFs (and certain other file formats) are [blocked for delivery](image_delivery_options#blocked_delivery_formats_for_security) by default for FREE accounts. To deliver PDFs, make sure the **Allow delivery of PDF and ZIP files** option is selected in the **Security** page of the Console Settings.

> **TIP**:
>
> This page describes how to create a PDF from multiple files with a backend API call. 
> You can also generate and deliver a PDF file from a **single** image as an on-the-fly transformation by just changing the delivery URL file extension (or setting the `format` parameter) to `pdf`, along with any image transformations you might want to apply. For details, see [Delivering images in a different format](image_transformations#delivering_in_a_different_format).

## Create the PDF

Use the [multi method of the Upload API](image_upload_api_reference#multi_method) to create the PDF file. PDF files can be created from a maximum of 500 images if processed asynchronously (`async` parameter = true) or a maximum of 100 if synchronously (`async` = false).  If the limit is exceeded, only the first 500 (or 100) images will be included.

For example, to create a PDF file from a set of images that each have the tag "topic", use the `multi` method, specifying the format as `pdf`, and optionally add some transformations to each of the images that are added:

```multi
|ruby
Cloudinary::Uploader.multi("topic", format: "pdf", transformation: {width: 800, crop: "lfill", gravity: "auto"})

|php_2
$cloudinary->uploadApi()->multi("topic", 
  ["format"=>"pdf", "transformation"=>["width"=>800,"crop"=>"lfill","gravity"=>"auto"]]);

|python
cloudinary.uploader.multi("topic", format = "pdf", transformation={"width": 800, "crop": "lfill", "gravity": "auto"})

|nodejs
cloudinary.v2.uploader
.multi("topic",
  {format: "pdf", transformation: {width: 800, crop: "lfill", gravity: "auto"}})
.then(result=>console.log(result)); 

|java
cloudinary.uploader().multi("topic", 
  ObjectUtils.asMap(
    "format", "pdf"
    "transformation", new Transformation().width(800).crop("lfill").gravity("auto"));

|csharp
var multiParams = new MultiParams("topic"){Format = "pdf", Transformation = new Transformation().Width(800).Crop("lfill").Gravity("auto")};
var multiResult = cloudinary.Multi(multiParams); 

|go
resp, err := cld.Upload.Multi(ctx, uploader.MultiParams{
		Tag:            "topic",
		Format:         "pdf",
		Transformation: "c_scale,w_800/c_lfill,g_auto"})

|curl
curl https://api.cloudinary.com/v1_1/demo/image/multi -X POST --data 'tag=topic&format=pdf&transformation=w_800,c_lfill,g_auto&timestamp=173719931&api_key=436464676&signature=a788d68f86a6f868af' 

|cli
cld uploader multi "topic" format="pdf" transformation='{"width": 800, "crop": "lfill", "gravity": "auto"}'
```

## Deliver the PDF

To deliver the PDF, use the Cloudinary image delivery URL with `type` set to `multi`. For example, to deliver the PDF created from all images with the tag `topic`:

![PDF created from all images with the topic tag](https://res.cloudinary.com/demo/image/multi/topic.pdf "with_image: false")

```nodejs
cloudinary.image("topic.pdf", {type: "multi"})
```

```react
new CloudinaryImage("topic.pdf").setDeliveryType("multi");
```

```vue
new CloudinaryImage("topic.pdf").setDeliveryType("multi");
```

```angular
new CloudinaryImage("topic.pdf").setDeliveryType("multi");
```

```js
new CloudinaryImage("topic.pdf").setDeliveryType("multi");
```

```python
CloudinaryImage("topic.pdf").image(type="multi")
```

```php
(new ImageTag('topic.pdf'))
	->deliveryType("multi");
```

```java
cloudinary.url().transformation(new Transformation().type("multi").imageTag("topic.pdf");
```

```ruby
cl_image_tag("topic.pdf", type: "multi")
```

```csharp
cloudinary.Api.UrlImgUp.Action("multi").BuildImageTag("topic.pdf")
```

```dart
cloudinary.image('topic.pdf').transformation(Transformation()
	.setDeliveryType("multi"));
```

```swift
imageView.cldSetImage(cloudinary.createUrl().setType( "multi").generate("topic.pdf")!, cloudinary: cloudinary)
```

```android
MediaManager.get().url().transformation(new Transformation().type("multi").generate("topic.pdf");
```

```flutter
cloudinary.image('topic.pdf').transformation(Transformation()
	.setDeliveryType("multi"));
```

```kotlin
cloudinary.image {
	publicId("topic.pdf")
	 deliveryType("multi") 
}.generate()
```

```jquery
$.cloudinary.image("topic.pdf", {type: "multi"})
```

```react_native
new CloudinaryImage("topic.pdf").setDeliveryType("multi");
```

Learn more about the [multi method](image_upload_api_reference#multi_method) in the Upload API reference.

> **TIP**: Consider [optimizing your PDFs](pdf_optimization) on delivery.

> **INFO**: By combining multiple images in this way, the resulting PDF may exceed the maximum file size allowed in your plan, in which case you will see the error, "File size too large."  Consider using a transformation on each of the images, using the `transformation` parameter, to reduce the size of the images so as to reduce the size of the resulting PDF file.

