Web Analytics

Fill the form & Get Installation Support

How to Allow PDF file in Wysiwyg Editor Magento 2

In this post, I’ll guide you how to allow PDF file on CMS Page, CMS Block and Product page Wysiwyg Editor.

By default, Magento does not provide such functionality. So, you need to create a custom module or use your any existing module and create few files on that which are mentioned below.

There are two steps:

Add pdf to allowed extensions type. With that modification only, the file will upload but with an exception because Magento tries to resize the pdf.
Override the upload method to resize images only.

First, you need to create di.xml file at app/code/Vendor/Modulename/etc/di.xml and add the following code into that file.

Second, you need to create Storage.php file at app/code/Vendor/Modulename/Model/Cms/Wysiwyg/Images/Storage.php and add the following code into that file.

I hope this post helped you to find what you were looking for.

Fill the below form if you have any Magento programming need.





    Recent Articles

    Author Info

    Author Image

    Magento Developer

    Hire S. Gorjia

    Get a Free Quote





      /* second popup */

      Connect With Us