2012年11月18日 星期日

Google 使用Google來讀取PDF

今天忽然接道一個需求 要做瀏覽器來看PDF
當然chrome內有包所以可以直接閱讀
但IE 火狐則要另外安裝 於是找到以下參考網址
原來google也有天阿不愧是大神
<iframe src="http://docs.google.com/gview?url=http://ccbs.ntu.edu.tw/formosa/org/pdf/081-106.pdf&embedded=true" style="width:800px; height:600px;" frameborder="0"></iframe>
http://docs.google.com/viewer?url="你的ppt pdf"
url=就是pdf網址
width=寬度
height=高度
參考網址 http://blog.joaoko.net/archives/2033

以下網址特別說到連ppt也攪定喔!!
http://blog.joaoko.net/archives/2163

jQuery Loading且置中

html部份
<div id="divLoading" style="background-color: Red; color: White; visibility: hidden; position: absolute; top: 0px; left: 0px; z-index:9999"> 資料傳輸中,請稍候... </div>
js部份
 <script type="text/javascript"> 
 $(function () { 
  var positionleft = $(window).width() / 2 - $("#divLoading").outerWidth(true) / 2; 
  var positiontop = $(window).height() / 2 - $("#divLoading").outerHeight(true) / 2;
  $("#divLoading").css("left", positionleft + "px").css("top",positiontop); //設定不Cache 
  $.ajaxSetup({ cache: false });
  $("#divLoading").ajaxSend(function () {
   $(this).css("visibility", "visible");  
  $.ajax({ type: 'post', url: 'Handler1.ashx',     
   data: { q: "" }, 
   success: function (result) { 
    $('#content').html(result); 
    $('#content').trigger("create"); 
  } }); 
 }); 
</script>