tcpdf

How can I use TCPDF to make 2x6 sheets of labels that include 2D barcodes WITHOUT using columns OR 3rd-party classes?

送分小仙女□ 提交于 2019-12-05 20:35:52
For three weeks (I guess I'm that slows!) I've tried to use TCPDF's own examples as well as some suggestions found on this site to figure out how to do this using database records. Mr. Asuni has responded to some requests for help when others ask how to use 3rd party patches (classes) to get things going, only that it CAN be done in TCPDF without such classes. For whatever reason (perhaps my own misunderstanding) I have not been able to use TCPDF to print labels using his columns approach. Neither have I been willing to ditch TCPDF in favor of other possible solutions (reasons I won't go into)

TCPDF list item margin

瘦欲@ 提交于 2019-12-05 19:57:31
Couldn't find it anywhere. Having list: <ol> <li>Foo</li> <li>Bar</li> <li>Baz</li> </ol> and CSS: ul li, ol li{ margin-bottom: 10px; } While previewing list in browser, margin-bottom is interpreted correctly. Unfortunately, TCPDF somehow doesn't recognize this style (while recognizing other parts of included css file). Is there any trick/hack to make it work? tcpdf allows to define the vertical spaces for HTML tags, see Method setHtmlVSpace of TCPDF Class Documentation , use: $pdf->setHtmlVSpace(array( 'li' => array( 'h' => 5, // margin in mm ) )); The name of the html-Element is the key (li)

TCPDF - Pagenumbers not exactly right aligned

心已入冬 提交于 2019-12-05 19:28:44
问题 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');

tcpdf for Arabic display the characters as question marks '?????? ???'

本秂侑毒 提交于 2019-12-05 17:00:36
I wanna create an Arabic pdf as same as the file witch I had in ms Execl format. While creating the pdf using tcpdf in php the Arabic charactors are displyaed as '????' marks. The characters are copied from my excel file $htmlcontent2 = '<span color="#0000ff">"مجوهرات السليمان"This is Arabic "مجوهرات السليمان" Example With TCPDF.</span>'; $pdf->WriteHTML($htmlcontent2, true, 0, true, 0); the output file display as below, ??? ???? ?????? ??????This is Arabic "??????? ????????" Example With TCPDF. I solved this issue by adding the following line: $pdf->SetFont('aealarabiya', '', 18); It turned

Certificate for TCPDF

余生颓废 提交于 2019-12-05 16:28:52
问题 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

Wrong page number on setPage() function: 0

强颜欢笑 提交于 2019-12-05 15:13:09
My code for tcpdf is $file_to_show_test_details = 'pdf_view_test_details.tpl'; $test_details= $smarty->fetch($file_to_show_test_details); // Set some content to print $html = <<<EOD $test_details EOD; // set default header data $pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, 'XYZ',$pdf->writeHTML($html, true, false, true, false, '')); The function writeHTML is not working, that's why the error 'Wrong page number on setPage() function: 0' appears in the browser. Could anyone please help me to solve this issue? Did you try to use addPage()? //$pdf = new PDF(); $pdf->AddPage(); For

tcpdf encode chinese character

坚强是说给别人听的谎言 提交于 2019-12-05 13:41:48
I am using tcpdf to create a pdf, but it cant show chinese character, instead it just show square box. I used this example that provided by them and then changed the cache/utf8test.txt to chinese character but it show "square box". How am I solve this? You need to use unicode supporting font, like you can use stsongstdlight font for chinese. Hope it helps try this $pdf->SetFont('kozminproregular', '', 12); It just helped me. Hope it also helps u. I managed to get it to work with the Arial Unicode font. $pdf->SetFont('arialuni', '', 12); Only issue is it's $165 http://www.fonts.com/font

How to set the background color for every page tcpdf

こ雲淡風輕ζ 提交于 2019-12-05 13:26:17
I'm currently using TCPDF to generate a resume in my web application. But with the limited support for css have cornered me. Now I'm trying to apply the background color for the every page that is generated. But I'm only getting the color for the first page. My code is: <?php class PROFILE_PDF extends TCPDF { public function Header() { $this->SetFillColor(52, 21, 0, 76); $this->Rect(0, 0, $this->getPageWidth(), $this->getPageHeight(), 'DF', ""); } private $footer_data = array(); public function Footer() { // Position at 15 mm from bottom $this->SetY(-15); // Set font $this->SetFont('helvetica'

TCPDF - Having footer/header on certain pages only

懵懂的女人 提交于 2019-12-05 12:52:27
I want to place the footer section on every page of my document except the first one. I created my custom footer by extending the TCPDF class and overriding its footer method. Then based on the documentation and using below example I understand I should use SetPrintHeader and SetPrintFooter methods: http://www.tcpdf.org/examples/example_002.phps // Page one $pdf->SetPrintHeader(false); $pdf->SetPrintFooter(false); $pdf->AddPage(); // Page two and on .. $pdf->SetPrintHeader(true); $pdf->SetPrintFooter(true); $pdf->AddPage(); However, the above does not prevent the footer/header from being

Change WhiteOctober TCPDF bundle configuration values

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-05 12:49:20
I've started using the WhiteOctober TCPDF bundle in my symfony project but I can't figure out how to change the default configuration values, such as page format. I've tried putting that in my config.yml: white_october_tcpdf: tcpdf: k_tcpdf_external_config: true pdf_page_format: 'LETTER' pdf_author: 'Company Name' pdf_header_title: 'Order Confirmation' pdf_header_string: 'Company Name' pdf_header_logo: '%kernel.root_dir%/../web/images/logo.png' pdf_header_logo_width: '35' pdf_margin_header: 15 pdf_margin_footer: 15 pdf_margin_top: 25 pdf_margin_bottom: 25 pdf_margin_left: 25 pdf_margin_right: