Topic: Version 2.4.6 PDF File Error

My server:
SuSE LINUX Leap 42.3
PHP 7
Apache 2
MySQL 15.1
Browser - Chrome

PDF reports generate in repository pdf_files is correct. PDF file in Downloads is corrupted (same for both Chrome and Firefox).

I would appreciate advise. Thanks


edtaned

Re: Version 2.4.6 PDF File Error

Change settings in browser for PDF viewer to be native viewers or specific programs - Acrobat / SumatraPDF.

Re: Version 2.4.6 PDF File Error

Hi apmuthu,
Thanks for your prompt reply.

The issue is not the PDF viewer. The file generated in the browser designated Downloads repository is incomplete. The file in repository pdf_files is complete and can be read by a PDF viewer (evince, okular).

There is no LINUX version of SumatraPDF and SuSE have stopped support of Acrobat.

Thanks

Re: Version 2.4.6 PDF File Error

Try Firefox browser or any other non chrome browser and see if it displays correctly. Also try to do a "Save As" of the download file link and see if it comes in correctly.

Re: Version 2.4.6 PDF File Error

I have tried both Chrome & Firefox. Looking at the demo version the popup link is to the pdf_files repository. However, on 2.4.6 I suspect the link is wrong. The report in the pdf_files repository is correct. If you set the browser to Download the file downloaded is not the report and cannot be opened with a pdf reader. If set to popup the browser responds with 'Error Failed to Load'

Re: Version 2.4.6 PDF File Error

Please try with a windows machine and the latest Firefox. Also post the URL for the right and wrong PDF paths.

Re: Version 2.4.6 PDF File Error

How is the file corrupted?   Open the containing folder and look at the file sizes.   Are they 0, truncated, same size as pdf_files?  Permissions, network file system issues, see https://support.mozilla.org/en-US/kb/cant-download-or-save-files.

Re: Version 2.4.6 PDF File Error

I solved this issue by avoiding the compression of the js scripts in 'includes/main.inc':

function js_compress($sJS)
{
    return($sJS); /* This line added to bypass js compress */

........
.........

}

Re: Version 2.4.6 PDF File Error

How rather odd and I wonder why?  I suppose you could also effect the same "fix" without changing the code and changing "go_debug = 1" in config.php?

Re: Version 2.4.6 PDF File Error

Changing "go_debug = 1" bypasses calling js_compress but it also affects other portions of the application software. I have tested this fix on both SuSE Liniux LEAP 42.3 and Ubuntu LINUX 3.28.1.