Follow along with the video below to see how to install our site as a web app on your home screen.
Бележка: This feature may not be available in some browsers.
r_a_s каза:Здравейте, как мога да направя динамичен pdf файл, тоест имам някаква информация в mysql за обяви и на всяка обява, като я извеждам да има различна информация в pdf файл? Никога не съм правил такова нещо и нямам никаква представа, как може да стане?
<?php
require('fpdf.php');
$pdf = new FPDF();
$pdf->AddPage();
$pdf->SetFont('Arial','B',16);
$pdf->Cell(40,10,'Hello World!');
$pdf->Output();
?>
Нали затова е pdf, за да не може да се редактира!?r_a_s каза:някой ще помогне ли или няма такъв?
Прочети как се конфигурира, провери си локалните пътища и като начало НЕ използвай имена на пътища/папки на кирилица по ред причини (като Нова папка-освен,че е на кирилица има и интервал, което трябва да е urlencoded, за да се подаде на браузъра), поне докато не го настроиш да работи...r_a_s каза:Свалих този class те са 4 файла, обаче в usage.php и Sql2PdfReport.class.php ми дава тези грешки - Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0
Fatal error: Unknown: Failed opening required 'E:/xampp/htdocs/Нова папка/usage.php' (include_path='.;E:\xampp\php\PEAR') in Unknown on line 0
Kak направи линукски път под windows? :lol: fopen опитва да отвори файл от Unix FS Can not open file /projects/rupom/phpclasses/sql2pdfreport/first_test.htmlr_a_s каза:Даже направих тези папки /projects/rupom/phpclasses/sql2pdfreport/ с html файла и пак ми дава същите грешки![]()
r_a_s каза:Благодаря ти, само че това ми отваря pdf файла като php страница.
Мен ме интересува, дали има начин да си е pdf файл, който да се сваля?
r_a_s каза:Да, deam0n точно това ми трябва, как да го направя![]()
RewriteEngine on
RewriteRule ^(.*)\.pdf$ $1.php
<?php
$file = 'proba.php';
if (file_exists($file)) {
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header("Content-Type: application/force-download");
header('Content-Disposition: attachment; filename=' . urlencode(basename($file)));
// header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
header('Content-Length: ' . filesize($file));
ob_clean();
flush();
readfile($file);
exit;
}
?>
r_a_s каза:ццц то ми го сваля ама като proba.php, а на тази страница ми е pdf-a и трябва да се сваля само той, а то ми сваля самата страница![]()
Output
string Output([string name, string dest])
Description
Send the document to a given destination: browser, file or string. In the case of browser, the plug-in may be used (if present) or a download ("Save as" dialog box) may be forced.
The method first calls Close() if necessary to terminate the document.
Parameters
name
The name of the file. If not specified, the document will be sent to the browser (destination I) with the name doc.pdf.
dest
Destination where to send the document. It can take one of the following values:
I: send the file inline to the browser. The plug-in is used if available. The name given by name is used when one selects the "Save as" option on the link generating the PDF.
D: send to the browser and force a file download with the name given by name.]
F: save to a local file with the name given by name (may include a path).
S: return the document as a string. name is ignored.
$pdf->Output("some-file-name.pdf", "D");