elibyy / laravel-tcpdf Goto Github PK
View Code? Open in Web Editor NEWlaravel-tcpdf
laravel-tcpdf
Hi
How do I save my file with the Persian language?
Persian character displayed with ?????
help me please
A coworker took a crack at it and found a similar issue with your readme.
But he did find a good solution...
Please update your readme to include that you need to use in your controllers:
use PDF;
Hope this eliminates any confusion and trouble in the future...
Dug into your code and saw some minor changes that are required in order for people to use your PDF tool.
Code is as follows:
use TCPDF;
$pdf = new TCPDF;
$pdf->SetTitle('Hello World');
$pdf->AddPage();
$pdf->Write(0, 'Hello World');
$pdf->Output('hello_world.pdf','D');
When I run composer update
I get the message:
"Package tecnick.com/tcpdf is abandoned, you should avoid using it. Use tecnickcom/tcpdf instead."
I have a Laravel command that syncs items (including generated pdf's) to a third party service via API. If there is only one PDF to generate, it runs fine, but if I have 2 items to sync, the command fails on the second PDF generation.
[ErrorException]
Undefined property: Elibyy\TCPDF\TCPdf::$h
I can't post my PDF generation code because I have secure business logic intertwined to generate the PDF. Do I need to have something at the end of the generation that resets TCPDF?
When trying to upgrade to Laravel 5.1, this service provider has a few composer conflicts. Any plans to upgrade to Laravel 5.1 LTS support?
I've tried printing headers and footers by extending your class and overwriting the Header() and Footer() functions. This does not work.
What is the correct way to use headers and footers with your wrapper?
use Elibyy\TCPDF\Facades\TCPdf;
class Pdf extends TCPdf
{
//Page header
public function Header() {
// Set font
$this->SetFont('helvetica', 'B', 20);
// Title
$this->Cell(0, 15, '<< TCPDF Example 003 >>', 0, false, 'C', 0, '', 0, false, 'M', 'M');
}
// Page footer
public function Footer() {
// Position at 15 mm from bottom
$this->SetY(-15);
// Set font
$this->SetFont('helvetica', 'I', 8);
// Page number
$this->Cell(0, 10, 'Page '.$this->getAliasNumPage().'/'.$this->getAliasNbPages(), 0, false, 'C', 0, '', 0, false, 'T', 'M');
}
}
seemed to be working and now this command is not? not seeing a header is my PDFs
Is there a way to load view and passing data to the view?
something like
$pdf = new TCPDF()
$pdf->SetPrintHeader(false);
$pdf->SetPrintFooter(false);
$pdf ->loadView('pdf.invoice', $data);
$pdf->Output(storage_path().'/pdf/file.pdf', 'I');
thanks.
How do I set font and Images folder in the config file after publishing.....can I refer to the assests folder on use the default paths......I think you should include one by default and add to the documentation.
Would it be possible to have a branch for 5.2 support?
As far as I can tell, the changes required would be:
And changing ServiceProvider.php#L30 from
$this->app->bindShared
to
$this->app->singleton
Still testing in my app. I can try to fix up a PR if you want.
Getting this error in the following function:
ErrorException in tcpdf.php line 3103:
Undefined property: Elibyy\TCPDF\Pdf::$inxobj
public function pdf_order($data, $order_id) {
ob_start();
//$this->getGenerateAffair($order_id);
$pdf = new PDF($orientation = 'P', $unit = 'in', $format = 'A4', $unicode = true, $encoding = 'UTF-8', $diskcache = false, $pdfa = false);
$pdf::SetPrintHeader(false);
$pdf::SetPrintFooter(false);
$pdf::AddPage();
$pdf::setHtmlVSpace(array('p' => array(array('n' => 0.01), array('n' => 0.01))));
$html = view('app.pdf.order/en_p1', $data)->render();
$pdf::writeHTML($html, true, false, true, false, '');
$pdf::AddPage();
$html = view('app.pdf.order/en_p2', $data)->render();
$pdf::writeHTML($html, true, false, true, false, '');
$pdf::lastPage();
$path = "./pdf/affairs/" . $order_id;
if (file_exists($path) == false) {
File::makeDirectory($path, $mode = 0777);
}
$pdf::Output(__DIR__ . '\..\..\..\public\pdf\affairs\\' . $order_id . '\\' . $order_id . '_affar.pdf', 'F');
ob_end_clean();
return;
}
Class 'PDF' not found
How can I use custom header or footer Using this package?
`use PDF;
PDF::SetTitle('Hello World');
PDF::AddPage();
PDF::Write(0, 'Hello World');
PDF::Output('hello_world.pdf');`
It work fine, but I can’t add custom header and footer!
readme example should use
use Elibyy\TCPDF\Facades\TCPdf as PDF;
How to set checkbox
I put in the required file.
I inserted the provider you gave.
I ran composer update.
I attempted to create a file.
An error is not thrown, but it ceases working for some reason.
If you need a deeper explanation or demonstration of what I am doing so you can improve this package, do let me know.
Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.