Menu ▾ ▴

#320 "View Online" -> Use pdf preview file if unsupported file format

5.1.1
wont-fix
nobody
None
feature-request
2020-12-02
2017-04-07
Tobias
No

When clicking "View Online" at some document formats - e.g. doc, docx, eml - they cannot be opened in the browser, and the browser initiates a download.
SeedDMS could instead look for an existing preview file in the cache and load this document or try to create this pdf preview file if it does not yet exist and if there is a converter suitable for this file type.

Discussion

  • dst

    dst - 2017-06-02

    change following on line 90: by PEAR PdfPreviewer.php

    if($target != '' && (!file_exists($target.'.pdf') || filectime($target.'.pdf') < filectime($infile))) {

    to

    if($target != '' && (!file_exists($target.'.pdf') || filectime($target.'.pdf') > filectime($infile))) {

    and be shure that www-data, apache2 user have right to write homefolder ("/var/www") that can unoconv write pdf.

     

    Last edit: dst 2017-06-02
    • Tobias

      Tobias - 2017-06-25

      This is not working, and i'm not shure why it should: if i'm right, the only thing different in the two lines is the < sign. Why should this open the pdf file?

       
  • Mr.Nam

    Mr.Nam - 2017-07-16

    I have the same problem not preview and not view online doc file, excel file.

     
  • Uwe Steinmann

    Uwe Steinmann - 2018-11-12
    • status: open --> wont-fix
     
  • Uwe Steinmann

    Uwe Steinmann - 2018-11-12

    The difference between ViewOnline and Download is simply, that Download will keep the browser from running an application which can display the file. In both cases the document remains unchanged. Changing this behaviour may confuse the user, because she/he may not be able to tell if the delivered file is the original file or a converted version of it.

     
  • Muhammad Asim

    Muhammad Asim - 2020-12-02

    Yes it is possible on code level changes you can use google doc viewer for .doc .exl .ppt
    add this code in file
    Enjoy!

    File: class.viewDocument.php

    if($accessobject->check_controller_access('ViewOnline', array('action'=>'run'))) {
                if ($viewonlinefiletypes && (in_array(strtolower($latestContent->getFileType()), $viewonlinefiletypes) || in_array(strtolower($latestContent->getMimeType()), $viewonlinefiletypes)))
    $fType = $latestContent->getFileType();
    

    if($fType == ".doc" || $fType == ".docx" || $fType == ".xls" || $fType == ".xlsx" || $fType == ".ppt" || $fType == ".pptx"){
    echo "

  • View Online
  • ";
    // echo "Some Other ";

                    }else{
    
                    print "<li><a target=\"_blank\" href=\"../op/op.ViewOnline.php?documentid=".$latestContent->getDocument()->getId()."&version=". $latestContent->getVersion()."\"><i class=\"fa fa-star\"></i>" . getMLText("view_online") . "</a></li>";
    

    }
    //echo $latestContent->getFileType();

            }
    
 

Log in to post a comment.