In one of ours latest project I needed to add PDF preview automatically every time when there is link to PDF file in page content.
Firstly I installed great plugin for PDF file preview. It’s allow me to generate preview window base on wordpress shortcode.
One problem left was that it won’t happen automatically. To achieve this I needed to use wordpress filter in my functions.php file.