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. :)
展示出的国防军问题
原标题:Showing generated PDF problem
最佳回答
<?
$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 );
相关问题
热门标签
- winforms
- combobox
- fogbugz
- java
- date
- internationalization
- asp.net
- iis
- url-rewriting
- urlrewriter
- c#
- enums
- ocaml
- haxe
- algorithm
- string
- viewstate
- .net
- c++
- c
- symbol-table
- mysql
- database
- postgresql
- licensing
- migration
- vb.net
- vb6
- declaration
- vb6-migration
- python
- psycopg2
- backup
- vmware
- virtualization
- gnu-screen
- authentication
- desktop
- excel
- xll
- cultureinfo
- regioninfo
- oracle
- client
- session
- download
- html
- virtual
- constructor
- scenarios
- perl
- full-text-search
- javascript
- ajax
- testing
- oop
- inheritance
- vim
- encapsulation
- information-hiding