좋은 아침입니다. 나는 질문이있다. 나는 html에서 pdf로 dompdf로 여러 개의 내보내기를 만든 다음 대량으로 여러 개의 내보내기를 압축 파일로 가져 오려고합니다. 거기에 누군가 어떻게 저를 보여줄 수 있습니까? 주의 :... 내 나쁜 영어복수 파일을 만드십시오 dompdf html to pdf를 우편 번호
이 내 대량
function bulk() {
$action = $this->input->post('action');
if ($action == "export") {
$export = $this->input->post('msg');
for ($i=0; $i < count($export) ; $i++) {
$this->load->library('Pdfgenerator');
$users = $this->model_csv->getDatabyDescription($export[$i]);
$desc = $users['description'];
$name = substr((strrchr($desc, '-')), 2);
$html = $this->load->view('formulir_new2', $users, true);
$this->pdfgenerator->generate($html,"E-Tax" . time() . $name, $i);
}
// echo "<script type='text/javascript'>";
// for($i=0;$i< count($export); $i++){
// $users = $this->model_csv->getDatabyDescription($export[$i]);
// $desc = $users['description'];
// $name = substr((strrchr($desc, '-')), 2);
// // echo "window.open('/pdf/E-tax{time()}{$name}{$i}.pdf');" ;
// echo "window.open('/pdf/E-Tax" . time() . $name . $i . ".pdf";
// }
// echo "</script>";
}
이 내 PDF 생성 라이브러리
public function generate($html, $filename, $i){
if($i == 0)
{
define('DOMPDF_ENABLE_AUTOLOAD', false);
}
require_once("./vendor/dompdf/dompdf/autoload.inc.php");
$file_to_save = $_SERVER['DOCUMENT_ROOT'] . '/exportdata/uploads/pdf/';
$dompdf = new dompdf();
$options = new Options();
$options->setIsRemoteEnabled(true);
$dompdf->setOptions($options);
$dompdf->set_paper(array(0,0, 612, 936), 'portrait');
$dompdf->load_html($html);
$dompdf->render();
$abc = $dompdf->output();
file_put_contents를 ($ file_to_save $ 파일 이름 $ 내가. "PDF", $ 죄송합니다 ABC);}
코드에 어떤 문제가 있습니까? 아무도 여기에 코드를 작성하지 않을 것이라고 언급하십시오. P – Bira