Welcome Guest, Not a member yet? Register   Sign In
Displaying pdf/word files in view
#1

[eluser]junaids[/eluser]
hi.
i have uploaded some articles in pdf and doc format in database. now in my application i want to display these articles in views..how to?
#2

[eluser]Dam1an[/eluser]
Can you be more specific as to wby you want to do this? I think in most cases, embeded documents are just bad
Just send the headers as a doc/pdf and let the browser deal with it, or let the user download it

It is possible to just get the text of a word document (Google will tell you how) so you could display that in your view, but I think it would be stripped of all formatting
#3

[eluser]junaids[/eluser]
i need to display articles just as they are displayed in blogs/tutorial sites
#4

[eluser]Dam1an[/eluser]
I've never come accross a blog or tutorial site which has embedded doc/pdf files :-S
Have you got an example of a site which does this? Cause as far as far as I know, they just have normal text in the database which is dropped in a HTML template
#5

[eluser]junaids[/eluser]
ok. if i have my users upload articles in pdf or doc format..and i store them in the DB. is there a way i can have text extracted from these articles and show them in views?
#6

[eluser]Dam1an[/eluser]
The only way of getting the contents of a work doc in PHP is via COM, are you running this on a windows box? Cause if not, I have no other suggestions
#7

[eluser]junaids[/eluser]
ya i m on windows. thanks for your suggestions
#8

[eluser]xwero[/eluser]
junaids your server also has to run windows to work with com calls in you application. Most servers run on linux. And the server has to have a recent office version on it too as only that version will be able to convert the most formats.

There are a few classes that let you extract content from word documents but none of the ones i found support all word versions. The same goes for pdf classes.

Proprietary binary files, like word docs and pdf, are hard to convert because there is no information how to retrieve the actual data the file contains. And then i leave out how the document is styled.

Because you can't do much with the files developers told the users to copy the content and paste it in a form field. If the form field has an editor functionality it will have a function to clean up the word doc styles but it is not 100% correct.

As dam1an mentioned you can go the easy way and let the document have a standalone status. Make it possible to upload or download them but not have the option to show them in the context of the site.
#9

[eluser]depthcharge[/eluser]
Flex?

I am sure i have seen this implemented on a few sites, a kind of PDF preview of a document etc.

Anybody aware of the tools they are using?
#10

[eluser]xwero[/eluser]
isn't flex adobe's server software? i never heard of a flex browser plugin.




Theme © iAndrew 2016 - Forum software by © MyBB