Php 允许复制使用tcpdf创建的pdf的内容

Php 允许复制使用tcpdf创建的pdf的内容,php,tcpdf,Php,Tcpdf,我正在使用tcpdf创建pdf文件。已创建PDF,但不允许复制其内容 问题: require_once('tcpdf_include.php'); $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); $pdf->SetProtection($permissions = array('print', 'modify', 'copy', 'annot-forms

我正在使用tcpdf创建pdf文件。已创建PDF,但不允许复制其内容

问题:

 require_once('tcpdf_include.php');
 $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);

 $pdf->SetProtection($permissions = array('print', 'modify', 'copy', 'annot-forms', 'fill-forms', 'extract', 'assemble', 'print-high'), '', null, 0, null);

 $pdf->SetCreator(PDF_CREATOR);


 $pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, 'License Export Details');

 // set header and footer fonts
 $pdf->setHeaderFont(Array('helvetica', '', PDF_FONT_SIZE_MAIN));
 $pdf->setFooterFont(Array('helvetica', '', PDF_FONT_SIZE_DATA));

 // set default monospaced font
 $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);

 // set margins
 $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
 $pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
 $pdf->SetFooterMargin(PDF_MARGIN_FOOTER);

 // set auto page breaks

 $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);

 // set image scale factor

 $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);

 // set some language-dependent strings (optional)

 if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
require_once(dirname(__FILE__).'/lang/eng.php');
$pdf->setLanguageArray($l);
        }


 $pdf->SetFont('times', '', 16);

 // add a page

 $pdf->AddPage();

 //Write the html

 $html='================= Data==============';


//Convert the Html to a pdf document
 $pdf->writeHTML($html, true, false, true, false, '');

//Close and output PDF document
  $pdf->Output('Export_Details.pdf', 'D');
我应该怎么做,这样我就可以复制pdf创建的内容。 这是可以实现的吗?请给我同样的指导。 谢谢 代码:

 require_once('tcpdf_include.php');
 $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);

 $pdf->SetProtection($permissions = array('print', 'modify', 'copy', 'annot-forms', 'fill-forms', 'extract', 'assemble', 'print-high'), '', null, 0, null);

 $pdf->SetCreator(PDF_CREATOR);


 $pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, 'License Export Details');

 // set header and footer fonts
 $pdf->setHeaderFont(Array('helvetica', '', PDF_FONT_SIZE_MAIN));
 $pdf->setFooterFont(Array('helvetica', '', PDF_FONT_SIZE_DATA));

 // set default monospaced font
 $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);

 // set margins
 $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
 $pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
 $pdf->SetFooterMargin(PDF_MARGIN_FOOTER);

 // set auto page breaks

 $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);

 // set image scale factor

 $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);

 // set some language-dependent strings (optional)

 if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
require_once(dirname(__FILE__).'/lang/eng.php');
$pdf->setLanguageArray($l);
        }


 $pdf->SetFont('times', '', 16);

 // add a page

 $pdf->AddPage();

 //Write the html

 $html='================= Data==============';


//Convert the Html to a pdf document
 $pdf->writeHTML($html, true, false, true, false, '');

//Close and output PDF document
  $pdf->Output('Export_Details.pdf', 'D');

我认为你应该删除这两行

$pdf->SetProtection($permissions = array('print', 'modify', 'copy', 'annot-forms', 'fill-forms', 'extract', 'assemble', 'print-high'), '', null, 0, null);

$pdf->SetCreator(PDF_CREATOR);

我已删除$pdf->SetProtection(),并获得了预期结果。谢谢