tcpdf

Print multipage PDF on different printer-trays

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-05 08:19:28
I am generating a PDF by PHP with FPDF. This works well. Now what I want: From a multipage PDF all pages expect the last one have to print with paper from tray1 and the last page from tray2. Now the Question: How is this possible? Is this a Acrobat Reader issue? Can it be done with JavaScript in PDF? It is not possible, as PDFs do not contain any information on the printer trays or other information. It is actually set in the printer instructions through the client's printer driver, who has to provide this information to the client program. If you need this functionality for batch processing,

How to use external css in tcpdf pdf generation

心不动则不痛 提交于 2019-12-04 16:42:05
问题 I am trying to create a pdf of a web page with tcpdf. But it's not working. The page is a php with external css and javascript files. Can anyone help me with this. Thanks, 回答1: To include external CSS file, you can do as below before you add your HTML content $html .= '<style>'.file_get_contents(_BASE_PATH.'stylesheet.css').'</style>'; By this, while you pass $html to generate pdf it will include those styles. As far I am aware, there is no need for including Javascript into a PDF . The

How to use TCPDF with PHP mail function

♀尐吖头ヾ 提交于 2019-12-04 13:17:23
问题 $to = 'my@email.ca'; $subject = 'Receipt'; $repEmail = 'rep@sales.ca'; $fileName = 'receipt.pdf'; $fileatt = $pdf->Output($fileName, 'E'); $attachment = chunk_split($fileatt); $eol = PHP_EOL; $separator = md5(time()); $headers = 'From: Sender <'.$repEmail.'>'.$eol; $headers .= 'MIME-Version: 1.0' .$eol; $headers .= "Content-Type: multipart/mixed; boundary=\"".$separator."\""; $message = "--".$separator.$eol; $message .= "Content-Transfer-Encoding: 7bit".$eol.$eol; $message .= "This is a MIME

TCPDF / FPDF - Page break issue

随声附和 提交于 2019-12-04 11:26:28
问题 I'm trying to create a PDF file with a table of data.. But when a page break is met it jumps to a new page everytime a new multicell is added to the page at the break point level..!? I have tried to do exactly the same with TCPDF, but still the same issue with a page break each time a new cell i added around the page break point level... example: http://www.online-økonomi.dk/_tst_fpdf.php require_once '../class/download/fpdf/fpdf.php'; class File_PDF { private $pdf; private $col_product = 25;

How can I put new line(<br> or \n) in TCPDF?

为君一笑 提交于 2019-12-04 07:34:23
问题 I am new in this TCPDF. I am trying to make my own template using TCPDF. I changed the header logo for my project and also the header title. The question is how can I put new line or <br> if I am not in the <<<EOD EOD; / ' '; ? NOTE: I changed the header logo in my tcpdf_autoconfig and the header title in my tcpdf_config file.. I want to new line the example_016 after the image of baliao etc etc etc View <?php //============================================================+ // File name :

Specific fonts in TCPDF pdf

家住魔仙堡 提交于 2019-12-04 06:55:10
Can somebody tell me what i am doing wrong? I need Arial font in my pdf generated by TCPDF. First I've tried to use that : 1) I got Arial from windows fonts caltalog and put it in TCPDF directory. 2) Next I wrote in script : $fontname = $pdf->addTTFfont('../lib/tcpdf/arial.ttf', '', '', 32); After that in tcpdf/fonts appears 3 files (arial.ctg.z , arial.php and arial.z). I thought that everything was ok but if in TCPDF i use this font by: $pdf->SetFont('arial', '', 16); Font in document is indeed arial but without polish specific sings (ąęłżńź) I've tried also prepare font by yourself : I

Force download PDF created by TCPDF, after Ajax post submit

微笑、不失礼 提交于 2019-12-04 06:08:37
My application allow the users to complete a form, and send it with an Ajax post call. The form si sent to the TCPDF class that create a PDF file. The class has the method "->output(...)" that permit to save the file into web server, send it to the browser, ecc... my goal is, after the form submit, create the PDF file, and force the user to download it (with no refreshing). The method doesn't work with ajax calls. The only solution I've found is create the file, seve it into web server, and than redirect the user to the location of the file to the web server; but it isn't a nice solution, I

TCPDF - Pagenumbers not exactly right aligned

我与影子孤独终老i 提交于 2019-12-04 02:46:51
I am using TCPDF to generate a pdf. My issue is the following line from the Footer() method: $this->Cell(0, 10, 'Page '.$this->getAliasNumPage().'/'.$this->getAliasNbPages(), 'T', false, 'R'); This is the standard line for inserting the pagenumber in the document's footer but there is a litte space to right in the output. You can see it in example 1 from the website: http://www.tcpdf.org/examples/example_001.pdf If I insert normal text like this: $this->Cell(0, 10, 'Foobar', 'T', false, 'R'); the text is perfectly aligned to the right without any problems. I digged into the source, it seems to

Certificate for TCPDF

大兔子大兔子 提交于 2019-12-04 01:50:00
I would like to generate a certificate(self-signed at the moment) for an encrypted PDF on the server. What is interesting to me is the workflow on how to to that with TCPDF. What I did: 1) Generate keys: openssl req -x509 -nodes -days 365000 -newkey rsa:1024 openssl pkcs12 -export -in tcpdf.crt -out tcpdf.p12 2) Then generate the PDF with the .crt - file 3) Then I started acrobat reader and installed the certificate ( tcpdf.p12 ). I used Document->security settings -> digital id 4) I could import the security settings but still can't open the PDF. Don't know if I am doing it right? What

PHP / TCPDF: Template Bug?

ぐ巨炮叔叔 提交于 2019-12-03 11:09:04
问题 I have been using TCPDF for sometime. It's simple to use, outputs low size PDF and is under active development. Following is the code for a page which should only have Hello World and a footer showing page number. However I get an additional Horizontal Line at the top of the page.It's bugging me. How do I get rid of it? <?php require_once('config/lang/eng.php'); require_once('tcpdf.php'); // create new PDF document $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8