用PHP打开PDF文件 [英] Open PDF file in PHP
本文介绍了用PHP打开PDF文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好我有编码来查看pdf文件中的一些文字
<?php
define(' FPDF_FONTPATH',' fpdf151 / font /');
require(' fpdf151 / fpdf.php');
$ pdf = new FPDF();
$ pdf-> Open();
$ pdf-> AddPage();
$ pdf-> SetFont(' Arial',' B',16);
$ pdf-> Cell(40,10,' Hello World!');
$ pdf->输出();
?>
但由于文件未开始我收到错误%PDF-
这里有什么问题?请帮助
解决方案
pdf = new FPDF();
pdf-> Open();
PDF-> AddPage();
Hi i have coding to view some text in a pdf file
<?php
define('FPDF_FONTPATH','fpdf151/font/');
require('fpdf151/fpdf.php');
$pdf=new FPDF();
$pdf->Open();
$pdf->AddPage();
$pdf->SetFont('Arial','B',16);
$pdf->Cell(40,10,'Hello World!');
$pdf->Output();
?>
but i am getting error as file does not begin with %PDF-
What is the problem here? Pls Help
解决方案
pdf=new FPDF();
pdf->Open();
pdf->AddPage();
这篇关于用PHP打开PDF文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文