I have used the following code to display a list of PDF files in an HTML page. I want to display the first page of every PDF file as the image icon for them. I am not using any servers as of now. Please guide me on this. Code goes here:
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="assets/css/bootstrap-responsive.css" rel="stylesheet">
<link href="css/bootstrap.min.css" rel="stylesheet" media="screen">
<link type="text/css" href="cssjquery/ui-lightness/jquery-ui-1.8.24.custom.css" rel="stylesheet" />
<title>Unit 3, ADS</title>
<style type="text/css">
.imagewrap {
display: inline-block;
position: relative;
}
.btn {
position: absolute;
top: 0;
right: 0;
}
</style>
<script src="js/bootstrap.min.js"></script>
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script src="http://code.jquery.com/jquery.js"></script>
<script type="text/javascript" src="jsjquery/jquery-1.8.2.min.js"></script>
<script type="text/javascript" src="jsjquery/jquery-ui-1.8.24.custom.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('a.btn').on('click',function(e){
e.preventDefault();
pdfID = $(this).closest('.imagewrap')[0].id;
$('#dialog').dialog('open');
alert('Deleting '+pdfID+'');
$(this).closest('.imagewrap')
.fadeTo(300,0,function(){
$(this)
.animate({width:0},200,function(){
$(this)
.remove();
});
});
});
});
</script>
</head>
<body>
<h1>PDF Files</h1>
<br><br>
<div class="imagewrap" id="pdf1">
<a href="something1.pdf"><img src="pdf icon.jpg" width="100" height="100" border="0"></a> <a class="btn" href="#"><i class=" icon-remove-sign" ></i></a>
</div>
<div class="imagewrap" id="pdf2">
<a href="something2.pdf"><img src="pdf icon.jpg" width="100" height="100" border="0"></a> <a class="btn" href="#"><i class=" icon-remove-sign" ></i></a>
</div>
<div class="imagewrap" id="pdf3">
<a href="something3.pdf"><img src="pdf icon.jpg" width="100" height="100" border="0"></a> <a class="btn" href="#"><i class=" icon-remove-sign" ></i></a>
</div>
</body>
P.S. : I have added imagewrap class to each div here because I was not able to add the remove icon to every pdf icon image otherwise.
Any help would be greatly appreciated. Thanks in advance