사이트 내 전체검색
PHP
php 에서 pdf 뷰어 기능 구현
로빈아빠
https://cmd.kr/php/872 URL이 복사되었습니다.

본문

 

1. 구글에서 지원해주는 것을 이용한다..
 

 <iframe src="http://docs.google.com/gview?url=http://funroo.gipsys.co.kr/module/pdf/jubo_130519.pdf&embedded=true" style="width:718px; height:700px;" frameborder="0"></iframe>


 


 

2. php 자체 기능을 이용해서 iframe으로 뿌려준다.

viewer.php


    <?php
    $file = './jubo_130519.pdf';
    $filename = 'jubo.pdf'; /* Note: Always use .pdf at the end. */

    header('Content-type: application/pdf');
    header('Content-Disposition: inline; filename="'.$filename . '"');
    header('Content-Transfer-Encoding: binary');
    header('Content-Length: ' . filesize($file));
    header('Accept-Ranges: bytes');

    @readfile($file);
    ?> 

 

<iframe src="./viewer.php" style="width:718px; height:900px;" frameborder="0"></iframe>

 

댓글목록

등록된 댓글이 없습니다.

PHP
871 (2/18P)

Search

Copyright © Cmd 명령어 3.147.7.30