Forums

TCPDF and html / css tag

giacall 28 Jul, 2014
1 Likes
I need a little information.
I'm using TCPDF action in 'on submit' event..
As i can understand, the TCPDF have a static header and footer.. I can not set a dynamic header content e.g. taking data from form field.. And also for the file name... i can not use dynamic file name..

It's correct??

Other question..

It's possible to insert into contents field some php code to set the html tag (div and table) and relative css setting??

Eg:

$sms = '
<style type="text/css">
<!--
#tds_container {
	font-family: calibri, Arial, Helvetica, sans-serif;
	font-size: 12px;
	font-style: normal;
	font-weight: normal;
	height: 100%;
	width: 600px;
	position: absolute;
}
#tds-row {
	background-color: #0099FF;
	width: 100%;
	padding: 10px;
	clear: both;
}
#tds-label {
	background-color: #00FFFF;
	float: left;
	height: auto;
	width: 14%;
	text-transform: uppercase;
	text-align: left;
	font-weight:bold;
}
#tds-content {
	background-color: #336666;
	float: left;
	height: auto;
	width: 86%;
	text-align: justify;
	vertical-align: top;
	overflow: visible;
}
#tds-content .titolo {
	font-size: 36px;
	font-style: italic;
	font-weight: bold;
	text-transform: uppercase;
	color: #FF0000;
	text-decoration: underline;
	display: inline;
	width: 100%;
	text-align: center;
}

-->
</style>

<div id="tds_container">
	<div id="tds-row">
  	<div id="tds-label">
    	tipologia
    </div>
    <div id="tds-content">
	    <div class="titolo">{tipologia}</div><br/>
    Manicotti ecologici performanti ad alto potere calorico con alta densità.
    </div>
  </div>
  
  <div id="tds-row">
  	<div id="tds-label">
			campo di applicazione
    </div>
    <div id="tds-content">
	    {campoapplicazione}
    </div>
  </div>
  
   <div id="tds-row">
  	<div id="tds-label">
			modalità impiego
    </div>
    <div id="tds-content">
			{modoimpiego}
    </div>
  </div>
  
</div>
';
 echo $sms;

?>


Thank's in advance
GreyHead 28 Jul, 2014
Hi giacall,

I did a quick test and it looks as though the header is static - that is, it won't accept form variables.

The same is true of the file name.

BUT I think that Max did recently post a way to dynamically override the action settings . . . except that right now I can’t find it :-(

Setting the Content including the CSS dynamically should work except that you can't mix and match curly brackets and PHP, You have to use $form->data['input_name'] instead of {input_name}

Bob
This topic is locked and no more replies can be posted.