Any idea how i make pdfs open as a page?

Permalink 1 user found helpful
Need pdfs to automatically open as a page in a new window, not be downloaded?

 
RobertJNL replied on at Permalink Reply
RobertJNL
Hi Sallot,

Frankly i think action is based on the users pc settings.

-Robert
Red3 replied on at Permalink Reply
Red3
I dont think you can open a PDF on or as a web page like goodfellow said, that would be opening it from the hosting server and I think that would be an issue with security. I also think its user preferance, I'm always asked to save or open a pdf from my pc.
aeroclown replied on at Permalink Reply
aeroclown
sorry, timed out on me.
aeroclown replied on at Permalink Reply
aeroclown
There are way to parse a pdf as html it just isn't simple. It requires the ability to execute a command line tool in most cases via php and then recover the output.

For instance you would need to execute something like pdftohtml built ontop of xpdf.

http://sourceforge.net/projects/pdftohtml/...

Don't however ask me how, that is certainly outside of my know how. I just know it can be done.
Remo replied on at Permalink Reply
Remo
Do you want to show pdf's a html code?!

I think he just doesn't want to download the pdf files, you can view pdf files if the activex control works properly..

nothing to do with pdf2html?!
katz515 replied on at Permalink Reply
katz515
I think... what it's been talked about is...

When you add the download link of a PDF, it creates the hyperlink of...

----------
XXXX/index.php/download_file/-/view/XXX
----------

This link tells the broswer to download a file instead of opening in the browser.

I am thinking about creating a custome template to resolve this issue...
synlag replied on at Permalink Reply
synlag
on a website, only works with iframe block.

rn
Remo replied on at Permalink Reply
Remo
no, you don't need an iframe.

you can either set content-disposition to inline if content-type is set to application/pdf or use an object:

<OBJECT WIDTH=640 HEIGHT=480>
    <PARAM NAME="SRC" VALUE="filePath"> 
    <EMBED SRC=filename.pdf WIDTH=1000 HEIGHT=680> 
        <NOEMBED> PDF should have displayed here!</NOEMBED> 
        </EMBED>
</OBJECT>

(I pasted this from my wiki, not sure where I found it, I never used it so far)
synlag replied on at Permalink Reply
synlag
good to know, wiki is always a good thing.
cannonf700 replied on at Permalink Reply
cannonf700
Remo,
Have you thought about making this into a add-on block. I think more and more this feature will be needed.
Remo replied on at Permalink Reply
Remo
yes but that kind of stuff causes lots of problems. Depending on your operating system, browser you'll have lots of different issues...

--> I'm probably not going to create an addon because of all the support requests. I don't mind publishing something for free but I don't have the time nor the patience to help everyone for free..
Fernandos replied on at Permalink Reply
Fernandos
here's an example using colorbox to load pdfs within a new window in the same window.

http://www.fif-moebel.de/services/downloads/...

of course this has something to do with your .htaccess and the mime-type settings for pdf.

I doubt sallott is reading this post anymore, but this could be of help to others.
isha replied on at Permalink Reply
This is case with the content block (chrome browser)

<a href="doc.pdf" target="_blank"> link</a>


open new window but

<a href="/index.php/download_file/view/120/" target="_blank">link</a>


don't. How to fix this?
BrettDashwood replied on at Permalink Reply
BrettDashwood
Instead of linking to a page or a file, insert a link to the actual PDF.

Here is a step by step approach that I use:

1. Go to the Dashboard and open the File Manager

2. Find or Upload your file. Click on it and select 'Properties'

3. Highlight the 'URL to file' and Copy to the Clipboard (eg. Ctrl+C)

4. Close the File Manager, and 'Return to Website'

5. Enter edit mode for your content block

6. Highlight the text that is going to be your link and instead of 'Add File', select 'Insert/edit link' (middle of the bottom row of editing icons)

7. Paste the URL you have on the clipboard into the Link URL, choose your Target option, enter any Title tags and class requirements...and press Insert.

Done!

I hope this helps.
shabib1819 replied on at Permalink Reply
This worked great. Thanks a bunch!
BrettDashwood replied on at Permalink Reply
BrettDashwood
Glad you liked it and it worked for you. I have submitted this as an idea that should be standard functionality and Franz has come back saying it will be looked at. Fingers crossed.