pdf - Transferring a file from an input to an iframe JavaScript -


i working on project : need extract text of pdf file , put text in "div".

for moment managed using tag <iframe>.

but works when know path of pdf file instance : src="nameofthefile.pdf" or src="folder/nameofthefile.pdf"... , have same result when pdf file uploaded extern users in front-end.

so think tag <input id="input" type="file"> when used alone pdf manage text still encoded ...

so here questions (sorry 4 questions ... :p)

0) firstly easy decode pdf text can use <input> tag ?

1) if not can file in input , stock in iframe ? (thanks javascript)

2) if answer second question "no" exist way upload pdf file in iframe , give frame special "src"attribute. or possible define dynamically attribute "src" (like in day-to-day language : "if user uploads pdf file, programm able know pdf @ precise place , can extract text" ?

3) or last question : possible upload file tag <iframe> using javascript or maybe jquery no ajax or php? if not method should work on ?

(i don't want use backend technologies php^^)

to sum code : integrated code https://github.com/hubgit/hubgit.github.com/tree/master/2011/11/pdftotext project. need know src of pdf ...

thank you.

i don't know if can "extract" text out of pdf. think part "special" src attribut easyest way use php.

<?php  $file = //some code choosing newest file in directory; echo '<iframe src="',$file,'"></iframe>'; ?> 

Comments