0
Wie PDF-Datei oder doc-Datei auf einer Webseite angezeigt wird, die von der entfernten Stelle kommt. Für vom Server zum Client Beispiel-Eine pdf/doc-Datei auf einer Webseite anzeigen
<!DOCTYPE html> //specifying the html version
<html> //a html file will show on to the remote browser
<head>// head element of an html
<meta charset="ISO-8859-1">
<title>Insert title here</title>
<script>
function addMoreInputType() //custom function when a button is clicked
{ // opening of a function
var ip=document.getElementById("p1"); // id of a <p>tag
var cele=document.createElement("embed");//creating a new html element
cele.setAttribute("src","1.pdf"); //setting an attribute named src and 1.pdf is the pdf file on the server which i wanted to show on the client browser
cele.setAttribute("width","600px"); //setting an attribute named width to diplay
cele.setAttribute("height","500px");//setting an attribute named height
cele.setAttribute("alt","pdf");
cele.setAttribute("pluginspace","http://www.adobe.com/products/acrobat/readstep2 .html");// that is the plugin
cele.setAttribute("internalinstanceid","14");// that is setting the attribute for the new html element
ip.appendChild(cele);// finally appending it to p tag child
} //closing of a function
</script> // ending of the script tag
</head> //end of the head tag
<body> // the content to be displayed on the client browser
<input type="button" value=" clickme " onclick="addMoreInputType()">Button click// a button which on clicking will invoke the addM....() so that they will request to server to give the pdf file and show onto browser's webpage area
<p id="p1"></p> // p tag having id p1
</body>//end of body of html
</html>//end of html file
Sie brauchen nur die richtigen Bibliotheken, um ihren Inhalt zu lesen. Danach können Sie es anzeigen. Für pdf gibt es eine ITEXT-Bibliothek. – SacJn
können Sie mir die aktualisierte Lösung – Siddharth
mit dem Ajax-Code zur Verfügung stellen, da ich Ajax verwende – Siddharth