SetLineStyle(array('width' => 0.85 / $this->k, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))); //$this->SetY((2.835 / $this->k) + max($imgy, $this->y)); //if ($this->rtl) { // $this->SetX($this->original_rMargin); //} else { // $this->SetX($this->original_lMargin); //} //$this->Cell(($this->w - $this->original_lMargin - $this->original_rMargin), 0, '', 'T', 0, 'C');​Lines 4266 - 4273//Print page number - modified if ($this->getRTL()) { $this->SetX($this->original_rMargin); // $this->Cell(0, 0, $pagenumtxt, 'T', 0, 'L'); } else { $this->SetX($this->original_lMargin); // $this->Cell(0, 0, $this->getAliasRightShift().$pagenumtxt, 'T', 0, 'R'); }​The first problem is, that the message from the form {nachricht} isn't shown in the generated PDF document, it just shows {nachricht}.​My second problem is, that the generated PDF file is generated with five (5!!!) pages:​1. first page is blank2. second page shows the first image, which is correct3. third page is blank4. fourth page shows the second image, which is correct5. fifth page shows {nachricht}​Can anyone help me with this?​Also, is it possible to use e.g. divs with background-image:"", so I can get the message to the right place on the PDF?​Thank you very much in advance,​Best regards!Joomla 3.8.6Chronoforms Component 6.0.17"> TCPDF - Multipage with background images and text from form field - Forums

Forums

TCPDF - Multipage with background images and text from form field

gatekeepa123 30 Mar, 2018
Hi there,

(please delete https://www.chronoengine.com/forums/posts/t105334; I used the wrong subforum)

I'm trying to have a chronoforms form generate a pdf document with two pages, then send this file via email and delete it on the server.

The pdf file is a template with one big image at the top of the first page and a small image in the bottom right corner of the second page, the message from the form field should be displayed starting at the second half of the second page (see attached images).






I think the simplest solution would be just to populate the second page of a pdf template with the message, but i dont know how to accomplish that.

So i'm working on a different aproach, where the pdf file is generated via TCPDF. I created two a4 fullpage jpgs (2480x3508 px, 300dpi) and added the following code to the TCPDF-action in the "submit" area in the chronoforms backend (the form field via the message has the value "nachricht" in the designer tab "name" and "id" fields:
<style type="text/css"> * {margin:0; padding:0; text-indent:0; }</style><img width="794" height="1123" alt="image" src="/administrator/pdf_images/Image_001.jpg"/><img width="794" height="1123" alt="image" src="/administrator/pdf_images/Image_002.jpg"/>{nachricht}

Screenshots of the chronoforms settings:





To get rid of the tcpdf header and footer I commented the following lines from /librariers/cetcpdf/tcpdf/tcpdf.php

Lines 4200 - 4208
// print an ending header line - modified //$this->SetLineStyle(array('width' => 0.85 / $this->k, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))); //$this->SetY((2.835 / $this->k) + max($imgy, $this->y)); //if ($this->rtl) { // $this->SetX($this->original_rMargin); //} else { // $this->SetX($this->original_lMargin); //} //$this->Cell(($this->w - $this->original_lMargin - $this->original_rMargin), 0, '', 'T', 0, 'C');

Lines 4266 - 4273
//Print page number - modified if ($this->getRTL()) { $this->SetX($this->original_rMargin); // $this->Cell(0, 0, $pagenumtxt, 'T', 0, 'L'); } else { $this->SetX($this->original_lMargin); // $this->Cell(0, 0, $this->getAliasRightShift().$pagenumtxt, 'T', 0, 'R'); }

The first problem is, that the message from the form {nachricht} isn't shown in the generated PDF document, it just shows {nachricht}.

My second problem is, that the generated PDF file is generated with five (5!!!) pages:

1. first page is blank
2. second page shows the first image, which is correct
3. third page is blank
4. fourth page shows the second image, which is correct
5. fifth page shows {nachricht}

Can anyone help me with this?

Also, is it possible to use e.g. divs with background-image:"", so I can get the message to the right place on the PDF?

Thank you very much in advance,

Best regards!
Joomla 3.8.6
Chronoforms Component 6.0.17
This topic is locked and no more replies can be posted.