English 中文(简体)
展示出的国防军问题
原标题:Showing generated PDF problem
  • 时间:2009-08-31 09:57:11
  •  标签:

I have a problem with showing generated PDF. The pdf is saved in dataBase. I m continuing work of a guy that started work that way, so I need to work that way. There s no problem with saving the file on computer,it s working fine, but I need to show it in new window when it s read from dataBase... And sorry about my English. :)

最佳回答
<?
 $pdf=pdf_new();
 pdf_open_file($pdf,"");
 pdf_begin_page($pdf,600,800);

 $font=pdf_findfont($pdf, Helvetica-Bold , host ,0);
 pdf_setfont($pdf,$font,30.0);
 pdf_show_xy($pdf,"Sample Text",50,600);

 pd_set_parameter($pfd,"openaction","fitpage");
 pdf_close($pdf);

 $buf=pdf_get_buffer($pdf);
 $len=strlen($buf);


 header("Content-Type: application/pdf");
 header("Content-Length: $len");
 header("Content-Disposition: inline; filename=sample.pdf");
 echo $buf;
 pdf_delete($pdf);
?>
问题回答

更多的信息和一些法典实例将是有益的。

在向窗口输出之前,你需要打上正确的头盔。

header( Content-type: application/pdf );




相关问题
热门标签