Title: Viewer width
Last modified: May 15, 2020

---

# Viewer width

 *  Resolved [Guido](https://wordpress.org/support/users/guido07111975/)
 * (@guido07111975)
 * [6 years ago](https://wordpress.org/support/topic/viewer-width/)
 * Hi Andy and Alex,
 * I’m using your plugin at a website that still has the Classic Editor installed,
   so just adding URL’s at the page. I notice the viewer has a maximum (fixed) width.
   In my case this means the PDF is still difficult te read. So is it possible to
   change that to full width?
 * And when I change width of the `embed-pdf-viewer` object class, the width of 
   the PDF stays the same.
 * Guido

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Plugin Author [Andy Fragen](https://wordpress.org/support/users/afragen/)
 * (@afragen)
 * [6 years ago](https://wordpress.org/support/topic/viewer-width/#post-12840378)
 * There’s a filter you can use, but nothing directly on a per PDF basis.
 * `$atts = apply_filters( 'embed_pdf_viewer_pdf_attributes', $atts );`
 * The $atts is an array with `$atts['height']` and `$atts['width']` whose values
   are set as pixels.
    -  This reply was modified 6 years ago by [Andy Fragen](https://wordpress.org/support/users/afragen/).
 *  Thread Starter [Guido](https://wordpress.org/support/users/guido07111975/)
 * (@guido07111975)
 * [6 years ago](https://wordpress.org/support/topic/viewer-width/#post-12842241)
 * Hi Andy,
 * Thanks, have added this simple code snippet in my theme functions file:
 *     ```
       // add custom height and width
       function my_callback() {
       	$atts['height'] = '1000';
       	$atts['width'] = '1200';
       	return $atts;
       }
       add_filter( 'embed_pdf_viewer_pdf_attributes', 'my_callback', 11 );
       ```
   
 * Guido
 *  Plugin Author [Andy Fragen](https://wordpress.org/support/users/afragen/)
 * (@afragen)
 * [6 years ago](https://wordpress.org/support/topic/viewer-width/#post-12842274)
 * You should pass the `$atts` parameter into the function also.
 * `function my_callback( $atts ) {`
 *  Thread Starter [Guido](https://wordpress.org/support/users/guido07111975/)
 * (@guido07111975)
 * [6 years ago](https://wordpress.org/support/topic/viewer-width/#post-12842288)
 * Thanks Andy,
 * It does work without, but I’m not a hardcore coder so still have much to learn.
   Can you please explain why I need to add that?
 * Guido
 *  Plugin Author [Andy Fragen](https://wordpress.org/support/users/afragen/)
 * (@afragen)
 * [6 years ago](https://wordpress.org/support/topic/viewer-width/#post-12842333)
 * In WordPress, filter hooks always pass at least one parameter. This is the parameter
   or value that the user changes. If you know the format and expected contents 
   of the return value then it’s not a problem.
 * In this case, only returning the values for width and height and not the value
   for ‘title’, will result in a unset value for title.
 * Perhaps a better way to explain this is when a filter passes an array, change
   the values you want and return the entire array.
 *  Thread Starter [Guido](https://wordpress.org/support/users/guido07111975/)
 * (@guido07111975)
 * [6 years ago](https://wordpress.org/support/topic/viewer-width/#post-12844469)
 * Understood, thanks for the clarification!
 * For other users with the same width issue: in my case the viewer had a certain
   width because of the [Content Width](https://codex.wordpress.org/Content_Width)
   that was set in file functions of my theme.
 * Guido

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Viewer width’ is closed to new replies.

 * ![](https://ps.w.org/embed-pdf-viewer/assets/icon.svg?rev=2883712)
 * [Embed PDF Viewer](https://wordpress.org/plugins/embed-pdf-viewer/)
 * [Support Threads](https://wordpress.org/support/plugin/embed-pdf-viewer/)
 * [Active Topics](https://wordpress.org/support/plugin/embed-pdf-viewer/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/embed-pdf-viewer/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/embed-pdf-viewer/reviews/)

 * 6 replies
 * 2 participants
 * Last reply from: [Guido](https://wordpress.org/support/users/guido07111975/)
 * Last activity: [6 years ago](https://wordpress.org/support/topic/viewer-width/#post-12844469)
 * Status: resolved