Enabling Auto-Generate All Pages for PDF and TIFF with Unsigned Upload Preset for unsigned

WizPS
WizPS Member Posts: 3

Hi,

I’m using an unsigned Upload Preset for my uploads, and I’d like to enable the automatic generation of multiple pages for my PDF and TIFF files. Currently, only the first page (pg_1) is being generated and accessible for querying, while the remaining pages are not.

Could you please guide me on how to enable the "Auto-create images for all pages" option in my Upload Preset to ensure all pages are processed and accessible?

Thank you for your assistance!

Tagged:

Answers

  • Cloudinary Team
    Cloudinary Team Administrator, Cloudinary Staff Posts: 176 admin

    Hi there,

    Thanks for contacting us.

    To protect the security and integrity of our customer accounts, we restrict the ability of new accounts to deliver PDFs and Archive files like .zip or .rar.

    It's always possible to upload and manage those files, and you can download them using our Media Library, but a restriction applies to deliver them publicly and you'll see an HTTP 401 error in that case.

    For PDFs that are uploaded as resource_type: 'image', it's possible to use those PDFs with our transformations features, so you can convert the PDFs to another image format and deliver them that way, such as by using the page transformation (pg_ in URLs) and setting the extension to an image format like jpg: https://res.cloudinary.com/demo/image/upload/pg_1/multi_page_pdf.jpg

    You can remove this restriction yourself if you're sure that any PDF or archive files uploaded by your users will be compliant with our policies, by enabling the option in the "PDF and ZIP files delivery" section of your account's security settings.

    There's more information about that available in the documentation also: https://cloudinary.com/documentation/image_delivery_options#blocked_delivery_formats_for_security

    Kind regards,

    Tia
    Developer Support Engineer
    Cloudinary


    🧑‍🎓 Academy Training | 📖 Documentation | 📰 Blog

  • WizPS
    WizPS Member Posts: 3

    Thank you for your response! I have enabled the "PDF and ZIP files delivery" feature for my account now. Following this, I attempted to upload a multipage document using the following endpoint:

    Endpoint:
    https://api.cloudinary.com/v1_1/<my_acc>/image/upload

    Payload:

    {
    "file": "https://documstore.blob.core.windows.net/docpubprod/myblob.pdf",
    "upload_preset": "documAll",
    "pages": true
    }

    The upload was successful; however, there is no "pages" in the responce and I am encountering issues with retrieving individual pages. Specifically:

    1. When accessing the first page using:
      https://res.cloudinary.com/<my_acc>/image/upload/pg_1/v1234567/c13upjzkcckfkzbcg48r.jpg
      The response is correct, and the file is accessible.
    2. However, for subsequent pages (e.g., page 2 and onwards) using URLs like:
      https://res.cloudinary.com/<my_acc>/image/upload/pg_2/v1234567/c13upjzkcckfkzbcg48r.jpg
      I receive a 400 Bad Request error.

    Could you please advise why this might be happening? Am I missing any specific configuration or process to enable multipage support for the uploaded file?

    Thank you in advance for your assistance!

  • Cloudinary Team
    Cloudinary Team Administrator, Cloudinary Staff Posts: 176 admin

    Hi there,

    I took a look at your upload preset, and I see that you're using the format parameter to convert the asset to a JPG before it's saved in your account. That's why you are only seeing the first page.
    If you remove that parameter, you should be able to deliver a selected page of your PDF. Can you give that a try and let me know how it goes?

    Kind regards,

    Tia
    Developer Support Engineer
    Cloudinary


    🧑‍🎓 Academy Training | 📖 Documentation | 📰 Blog

  • WizPS
    WizPS Member Posts: 3

    Thank you so much, Tia! It's working perfectly now—you're amazing! ❣️

  • Cloudinary Team
    Cloudinary Team Administrator, Cloudinary Staff Posts: 176 admin

    Hi there,

    Pleasure 😊 I'm glad it's working now!

    Kind regards,

    Tia
    Developer Support Engineer
    Cloudinary


    🧑‍🎓 Academy Training | 📖 Documentation | 📰 Blog