Advertisement
pusatdata

PDF File Embed Viewer

Jun 14th, 2018
2,118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.41 KB | None | 0 0
  1. <iframe src="https://docs.google.com/viewer?url=http://infolab.stanford.edu/pub/papers/google.pdf&embedded=true" style="width:600px; height:500px;" frameborder="0"></iframe>
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10. ## Office Web Apps Viewer
  11. ('.ppt' '.pptx' '.doc', '.docx', '.xls', '.xlsx')
  12.  
  13. http://view.officeapps.live.com/op/view.aspx?src=[OFFICE_FILE_URL]
  14.  
  15. <iframe src='https://view.officeapps.live.com/op/embed.aspx?src=[OFFICE_FILE_URL]' width='px' height='px' frameborder='0'>
  16. </iframe>
  17.  
  18. ### OneDrive Embed Links
  19.  
  20. **Powerpoint**
  21.  
  22. ```
  23. <iframe src="https://onedrive.live.com/embed?cid=CA582F2BC3AD1590&resid=CA582F2BC3AD1590%2133463&authkey=AFh1O3tkDLAQzzw&em=2" width="402" height="327" frameborder="0" scrolling="no"></iframe>
  24. ```
  25.  
  26. **Excel**
  27.  
  28. ```
  29. <iframe src="https://onedrive.live.com/embed?cid=CA582F2BC3AD1590&resid=CA582F2BC3AD1590%2136277&authkey=AHJ96YRJIbbJcec&em=2" frameborder="0" scrolling="no" width="800" height="346"></iframe>
  30. ```
  31.  
  32. ## Google Docs Viewer
  33.  
  34. Only files under 25 MB can be previewed with the Google Drive viewer.
  35.  
  36. Google Drive viewer helps you preview over 16 different file types, listed below:
  37.  
  38. * Image files (.JPEG, .PNG, .GIF, .TIFF, .BMP)
  39. * Video files (WebM, .MPEG4, .3GPP, .MOV, .AVI, .MPEGPS, .WMV, .FLV)
  40. * Text files (.TXT)
  41. * Markup/Code (.CSS, .HTML, .PHP, .C, .CPP, .H, .HPP, .JS)
  42. * Microsoft Word (.DOC and .DOCX)
  43. * Microsoft Excel (.XLS and .XLSX)
  44. * Microsoft PowerPoint (.PPT and .PPTX)
  45. * Adobe Portable Document Format (.PDF)
  46. * Apple Pages (.PAGES)
  47. * Adobe Illustrator (.AI)
  48. * Adobe Photoshop (.PSD)
  49. * Tagged Image File Format (.TIFF)
  50. * Autodesk AutoCad (.DXF)
  51. * Scalable Vector Graphics (.SVG)
  52. * PostScript (.EPS, .PS)
  53. * TrueType (.TTF)
  54. * XML Paper Specification (.XPS)
  55. * Archive file types (.ZIP and .RAR)
  56.  
  57. ### Google Docs Viewer (Apps)
  58. https://docs.google.com/a/[DOMINIO]/viewer?url=[FILE_URL]
  59.  
  60. ### Google Docs Viewer
  61. https://docs.google.com/a/[DOMINIO]/viewer?url=[FILE_URL]
  62.  
  63. ## Google Drive
  64.  
  65. **Sheets**
  66.  
  67. ```
  68. <iframe src="https://docs.google.com/spreadsheets/d/13R8O15c_sZKZT2QRHom1z2SDA3E1O5chUvROnqHCkwE/pubhtml?widget=true&amp;headers=true" style="width:100%;height:100%;"></iframe>
  69. ```
  70.  
  71. ### Embedded File Viewer
  72.  
  73. Google Docs offers an undocumented feature that lets you embed PDF files and PowerPoint presentations in a web page. The files don't have to be uploaded to Google Docs, but they need to be available online.
  74.  
  75. **Google Drive Viewer: Explicit PDF files**
  76. ```
  77. <iframe src="https://docs.google.com/viewer?url=http://infolab.stanford.edu/pub/papers/google.pdf&embedded=true" style="width:600px; height:500px;" frameborder="0"></iframe>
  78. ```
  79.  
  80. ```
  81. <iframe src="https://drive.google.com/viewerng/viewer?url=http://docs.google.com/fileview?id=0B5ImRpiNhCfGZDVhMGEyYmUtZTdmMy00YWEyLWEyMTQtN2E2YzM3MDg3MTZh&hl=en&pid=explorer&efh=false&a=v&chrome=false&embedded=true" frameborder="0"></iframe>
  82. ```
  83.  
  84. **Google Drive Viewer: Non-PDF files (fileviewer URL)**
  85.  
  86. To view Google Drive docs from fileviewer links, use the file ID as the `srcid` attribute in the iframe.
  87.  
  88. The file ID for your PDF (one that is already in Google Drive) can be found in the PDFs web address. When you open a PDF, it’s the garbage-looking piece of the URL (it will be between forward-slashes, β€œ/”).
  89.  
  90. ![](http://www.benschersten.com/blog/wp-content/uploads/2014/04/Screen_Shot_2014-04-30_at_8_29_17_AM.jpg)
  91.  
  92. The file ID is highlighted in yellow.
  93.  
  94. In this case it’s the 0B3xoQi_oa7_hU2J5S1RQbFdqS3c
  95.  
  96. Source: [http://docs.google.com/fileview?id=0B5ImRpiNhCfGZDVhMGEyYmUtZTdmMy00YWEyLWEyMTQtN2E2YzM3MDg3MTZh&hl=en&pid=explorer&efh=false&a=v&chrome=false&embedded=true](http://docs.google.com/fileview?id=0B5ImRpiNhCfGZDVhMGEyYmUtZTdmMy00YWEyLWEyMTQtN2E2YzM3MDg3MTZh&hl=en&pid=explorer&efh=false&a=v&chrome=false&embedded=true)
  97.  
  98. `id: 0B5ImRpiNhCfGZDVhMGEyYmUtZTdmMy00YWEyLWEyMTQtN2E2YzM3MDg3MTZh`
  99.  
  100. Or
  101.  
  102. Source: [https://drive.google.com/file/d/0B5ImRpiNhCfGZDVhMGEyYmUtZTdmMy00YWEyLWEyMTQtN2E2YzM3MDg3MTZh/view?ddrp=1&hl=en#](https://drive.google.com/file/d/0B5ImRpiNhCfGZDVhMGEyYmUtZTdmMy00YWEyLWEyMTQtN2E2YzM3MDg3MTZh/view?ddrp=1&hl=en#)
  103.  
  104. `id: 0B5ImRpiNhCfGZDVhMGEyYmUtZTdmMy00YWEyLWEyMTQtN2E2YzM3MDg3MTZh`
  105.  
  106. Result:
  107.  
  108. ```
  109. <iframe src="https://docs.google.com/viewer?srcid=[put your file id here]&pid=explorer&efh=false&a=v&chrome=false&embedded=true" width="580px" height="480px"></iframe>
  110. ```
  111.  
  112. ## Resources
  113.  
  114.  
  115. Info:
  116. http://www.labnol.org/internet/google-docs-viewer-alternative/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement