FPDF错误:已经输出了一些数据,无法发送PDF文件 [英] FPDF error: Some data has already been output, can't send PDF file

查看:109
本文介绍了FPDF错误:已经输出了一些数据,无法发送PDF文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好吧,我在尝试使用php类FPDF时遇到此错误:

well I get this error trying to use php class FPDF:

FPDF error: Some data has already been output, can't send PDF file (output started at
/mnt/webc/e1/12/5691512/htdocs/adminpanel/fpdf/test.php:1)

我的test.php

My test.php

<?php
require_once("fpdf.php");
$pdf = new FPDF();
$pdf->AddPage();
$pdf->SetFont('Arial','B',16);
$pdf->Cell(40,10,'Hello World!');
$pdf->Output();
?>

没有空格或任何东西...那么错误在哪里?

There are no blanks or anything... So where is the error???

推荐答案

某些编辑器添加了 BOM 在文件开头.

Some editors adds BOM at the start of a file.

以十六进制查看您的文件并将其删除

View your file in hex and remove it

这篇关于FPDF错误:已经输出了一些数据,无法发送PDF文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆