Item14044: format, width and height parameters for DOCUMENTVIEWER

pencil
Priority: Enhancement
Current State: Closed
Released In: n/a
Target Release: n/a
Applies To: Extension
Component: DocumentViewerPlugin
Branches: master
Reported By: MichaelTempest
Waiting For:
Last Change By: MichaelDaum
The DocumentViewerPlugin's %DOCUMENTVIEWER{...}% has undocumented parameters for the format ( portrait, landscape or screen ) and the height and width.

Firstly, these parameters should be documented.

Secondly, I propose that it should be possible to use any two of format, height and width (whereas the current implementation has format overriding height and width ). Here is a possible implementation:
    if ( $format eq 'portrait' ) {
      if ($params->{height}) {
         $height = $params->{height};
         $width = int(724 * $height / 1024);
      }
      else {
         $width = $params->{width} || 724;
         $height = int(1024 * $width / 724);
      }
    }
    elsif ( $format eq 'landscape' ) {
      if ($params->{height}) {
         $height = $params->{height};
         $width = int(1024 * $height / 724);
      }
      else {
         $width = $params->{width} || 1024;
         $height = int(724 * $width / 1024);
      }
    }
    elsif ( $format eq 'screen' ) {
      if ($params->{height}) {
         $height = $params->{height};
         $width = int(1024 * $height / 768);
      }
      else {
         $width = $params->{width} || 1024;
         $height = int(768 * $width / 1024);
      }
    }
    else {
        $width  = $params->{width}  || 724;
        $height = $params->{height} || 1024;
    }

-- MichaelTempest - 07 Apr 2016

Would you like to create a patch?

-- MichaelDaum - 12 Dec 2017
 
Topic revision: r3 - 28 Apr 2022, MichaelDaum
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy