簡體   English   中英

我在php中打開了pdf文件,如何保護它? 沒有人既不能下載也不能打印

[英]i have open pdf file in php and how can secure it ? no one can neither download nor print it

我通過php中的localhost運行PDF文件,瀏覽器中有一個打印PDF的選項,但我不希望它被打印。 這是我的代碼:

header('Content-type: application/pdf');
readfile('The C# 4.0 complete reference.pdf');
die();

請幫助我

試試這個代碼

   <?php
    header("Content-type:application/pdf");

    // It will be called downloaded.pdf
    header("Content-Disposition:attachment;filename='downloaded.pdf'");

    // The PDF source is in original.pdf
    readfile("original.pdf");
    ?>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM