OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



PDF-Files don't display inline after Upgrade

General inquiries about the PKP.

Moderators: jmacgreg, btbell, michael, bdgregg, vgabler, barbarah, John

Forum rules
Feel free to post general inquiries about the PKP Here. We'll also post notes of interest from time to time. You may also want to check out the PKP blog.

PDF-Files don't display inline after Upgrade

Postby rullrich » Wed Apr 09, 2014 7:20 am

Hello fellow OJS-Users,

after upgrading from version 2.3.1.2 to 2.4.3 we experience problems with the display of pdf files. We don't use ojs for publication yet but only to manage the workflow process, so my experience with the rendering of PDFs comes from the "create issue -> preview" function. Whenever I click on a pdf-link the plugin starts (in firefox at least), but stop displaying the file inline because it complains about the file not being valid pdf. Curiously the plugin saves a file called "Untitled.pdf" in my home-directory, and when I take a look at it with my editor it's plain html. We still use the older 2.3.1.2 version, where pdfs diplay as they should. I also tried the inline samples at http://pdfobject.com, where my plugin nicely embeds the pdf within the page. Can somebody help me please, because I really have no more ideas where to look for the fault. By the way, our installation runs on SuSE LS 11 SP 3, php 5.3.17 and MySQL 5.0.96. I migrated OJS applying the appropriate patch and then used the tools/upgrade.php. Could somebody please point me in the right direction? :D

Yours,
Ralf
rullrich
 
Posts: 7
Joined: Thu Dec 13, 2012 6:15 am

Re: PDF-Files don't display inline after Upgrade

Postby JasonNugent » Wed Apr 09, 2014 7:30 am

Hi Ralf,

The 'preview' component of OJS does require authenticated access. Can you check and make sure that the Google PDF Viewer plugin is not enabled? The Google viewer will not be able to read authenticated content and will generate a problem much like the one that you've experienced. If it's not, we can try other things.

Regards,
Jason
JasonNugent
Site Admin
 
Posts: 849
Joined: Tue Jan 10, 2006 6:20 am

Re: PDF-Files don't display inline after Upgrade

Postby rullrich » Thu Apr 10, 2014 1:13 am

Hi Jason,
thanks for Your answer. Meanwhile I enabled and disabled the google PDF Viewer, with varying results. With the disabled I encounter the problems I wrote about in my initial post; enabling it leads to the following message (translated from german):

The document wasn't found at its original position. You can load the original file from here (links to /ojs/index.php/iberoamericana/article/viewFile/343/15; the old OJS version linked to/ojs/index.php/iberoamericana/article/view/343/15,. which was found).

Yours, Ralf
rullrich
 
Posts: 7
Joined: Thu Dec 13, 2012 6:15 am

Re: PDF-Files don't display inline after Upgrade

Postby JasonNugent » Fri Apr 11, 2014 7:16 am

Hi Ralf,

If you have access to your MySQL database, can you have a look at the article_files table and see if the "file_type" column for those files representing your PDFs actually contains "application/pdf" instead of something like text/plain? Mime type handling has been problematic at times.

Regards,
Jason
JasonNugent
Site Admin
 
Posts: 849
Joined: Tue Jan 10, 2006 6:20 am

Re: PDF-Files don't display inline after Upgrade

Postby rullrich » Mon Apr 14, 2014 2:05 am

Hi Jason,

Mime-type is okay, and meanwhile the problem has disappeared after I upgraded our production ojs version. Now the PDF-files are displayed as they should; on our development-server I found out that the files-dir doesn't like symlinks. Maybe this has been the problem. But on our production site pdfs are displayed correctly. The only problem now are very slow admin pages, maybe by a failed authentication request or something similar.But for this problem I'm going to search the forum first.
Tnaks again for Your kind advise,

Ralf
rullrich
 
Posts: 7
Joined: Thu Dec 13, 2012 6:15 am

Re: PDF-Files don't display inline after Upgrade

Postby bluebear » Tue May 27, 2014 3:45 am

JasonNugent how can I change "file_type" in my database all at once?
bluebear
 
Posts: 3
Joined: Tue May 27, 2014 3:21 am

Re: PDF-Files don't display inline after Upgrade

Postby JasonNugent » Tue May 27, 2014 4:09 am

Hi bluebear,

You'd need to connect to your database directly (either through the command line client or a tool like phpmyadmin) and run an SQL statement on the table. Before you do that sort of thing, make sure you have a complete backup of your database because undoing such a change isn't possible. The statement would look something like:

UPDATE article_files SET file_type = 'application/pdf' WHERE original_file_name LIKE '%.pdf';

Regards,
Jason
JasonNugent
Site Admin
 
Posts: 849
Joined: Tue Jan 10, 2006 6:20 am


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest