Making a PDF Viewer with ajax or flash that can "search"?

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Making a PDF Viewer with ajax or flash that can "search"?

Post by josh »

It is possible to view a pdf document, complete with search functionality, in a flash player.

Last time I checked flash's loadMovie() family commands loaded .swfs .flvs .jpgs and maybe .pngs, but how are they doing this? How do they know the word "paper" appears on page 7, at position 200px by 50px or whatever? Check it out ( search is in lower right of document ) http://www.scribd.com/doc/17350937/The- ... hl-Excerpt

It works just like the real pdf viewers

I have openOffice up and convering .doc and .docx to .pdf, I am using a python bridge caled unoconv by Dag Wieërs and invoking it via PHP's exec() function.

I am using imageMagic with a postscript extension to convert .pdf to page1.jpg page2.jpg page3.jpg ( http://blog.robfelty.com/2008/03/11/con ... agemagick/ )

I read that xpdf is an opensource tool that happens to run on unix (!) that convert pdfs to text... but, I'm not sure how on scribd they arent just going to that overall page the text is found, they are highlighting the exact location of the found text within the page ( which is just a jpeg I believe ).

Google Cache has a document viewer that does the same thing, and firebug shows me they use .png files for each page. ( try this out by googling filetype:pdf ) and then dont click on the actual result link but the viewer link near the result http://docs.google.com/gview?a=v&q=cach ... l=us&pli=1

They have a free tool I can embed http://googlesystem.blogspot.com/2009/0 ... iewer.html but I would still be interested in how the workings of the search feature operate

I am very much interested in any ideas of the specifics. I am about to get out ethereal and try to see whats happening because firebug can't monitor flash's net activity
rsanjay
Forum Newbie
Posts: 2
Joined: Mon Jun 07, 2010 9:33 pm

Re: Making a PDF Viewer with ajax or flash that can "search"

Post by rsanjay »

Hi ,

I have a similar problem and that is i want to make e-documents i.e scan a document and make a pdf of it and the n convert the pdf to png and view the png in the browser and highlight text in the image and save it .

i am able to convert pdf to png using imagemagick and ghostscript but when i use pstotext utility , i am able to get the co-ordinates of literals and there by i read the co-ordinates and highlight it .

but is there an alternative for pstotext utility . pls help .
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Re: Making a PDF Viewer with ajax or flash that can "search"

Post by josh »

Where did you figure out about getting the coordinates of the letters from? Can you share your knowledge :D
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Re: Making a PDF Viewer with ajax or flash that can "search"

Post by alex.barylski »

You may be interested in usinf Adobe PDF command lien switches:

http://partners.adobe.com/public/develo ... meters.pdf

Might have something there to achieve what you need without third party software at all?

I would suspect that PDF readers which light words, etc are possibly using a existing reader and simply taking a screenshot of each page and delivering it in PNG format.

Cheers,
Alex
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Re: Making a PDF Viewer with ajax or flash that can "search"

Post by josh »

Id be more interested in something open source, the API is too "magical" for me, I want to see the insides tick! you said its possible with postscript rsanjay?
Post Reply