Pdf problem

Giovanni73
Giovanni73 Member Posts: 1
edited October 8 in Developer APIs

I have a folder that contains many subfolders. Each subfolder contains images and PDFs. I created a preset_img that converts all image types to JPG and a preset_pdf that doesn't modify anything. When I manually upload the folders, the PDFs are being converted using preset_img. The resource type is detected as "image" even for the PDFs. I also tried setting "Allowed Type" in preset_img, but the problem persists.

Tagged:

Answers

  • Tamara
    Tamara Member, Cloudinary Staff Posts: 117

    Hi there,

    By default, Cloudinary's automatic detection categorizes PDFs as image types so users can apply transformations to them.

    You can explicitly set the resource_type parameter to "raw" for your PDFs during upload. This ensures that we treat them as non-image files and apply the correct preset (preset_pdf in your case).

    Let me know if this helps, or if you have any further questions!

    Best regards,

    Tamara