php

  • strict warning: Non-static method view::load() should not be called statically in /var/www/freeasinkittens.com/sites/all/modules/views/views.module on line 906.
  • strict warning: Declaration of views_handler_argument::init() should be compatible with views_handler::init(&$view, $options) in /var/www/freeasinkittens.com/sites/all/modules/views/handlers/views_handler_argument.inc on line 0.
  • strict warning: Declaration of views_handler_filter::options_validate() should be compatible with views_handler::options_validate($form, &$form_state) in /var/www/freeasinkittens.com/sites/all/modules/views/handlers/views_handler_filter.inc on line 0.
  • strict warning: Declaration of views_handler_filter::options_submit() should be compatible with views_handler::options_submit($form, &$form_state) in /var/www/freeasinkittens.com/sites/all/modules/views/handlers/views_handler_filter.inc on line 0.
  • strict warning: Declaration of views_handler_filter_node_status::operator_form() should be compatible with views_handler_filter::operator_form(&$form, &$form_state) in /var/www/freeasinkittens.com/sites/all/modules/views/modules/node/views_handler_filter_node_status.inc on line 0.
  • strict warning: Non-static method view::load() should not be called statically in /var/www/freeasinkittens.com/sites/all/modules/views/views.module on line 906.
  • strict warning: Declaration of views_plugin_style_default::options() should be compatible with views_object::options() in /var/www/freeasinkittens.com/sites/all/modules/views/plugins/views_plugin_style_default.inc on line 0.
  • strict warning: Declaration of views_plugin_row::options_validate() should be compatible with views_plugin::options_validate(&$form, &$form_state) in /var/www/freeasinkittens.com/sites/all/modules/views/plugins/views_plugin_row.inc on line 0.
  • strict warning: Declaration of views_plugin_row::options_submit() should be compatible with views_plugin::options_submit(&$form, &$form_state) in /var/www/freeasinkittens.com/sites/all/modules/views/plugins/views_plugin_row.inc on line 0.

tcpdf rotate confusion

I spent the last few days fighting with dynamic generation of pdf files using the tcpdf php library.

tcpdf is not well documented, so much of the process of getting it to work is trial and error (and error and error...)

The one thing that really kicked my ass was trying to print an item rotated 90 degrees, and then getting another rotated item to print where I wanted it. Finally after reading the documentation a dozen times, I saw that my answer was there but is not all that clear.

If you want to have control over more than one rotated item, you have to add a line to start and end each rotation/transformation

for example, while it seems like it should, the following code does not position the barcode in the right place, it insists on placing it on the same y axis as the username

//print username
$pdf->setXY(71,3);
$pdf->SetFont('helvetica', 'b', 10);
$pdf->Rotate(-90);
$pdf->write(2,$userinfo->name);
$pdf->Ln();
//print barcode of uid
$pdf->setXY(18,45);
$pdf->SetTextColor(0,0,0);
$pdf->write1DBarcode($userinfo->uid, "C128A", '', '', 45, 4, 0.4,'', 'N');

but, adding in the start and stop transform commands as follows did exactly what I wanted

//print username
$pdf->setXY(71,3);
$pdf->SetFont('helvetica', 'b', 10);
$pdf->StartTransform();
$pdf->Rotate(-90);
$pdf->write(2,$userinfo->name);
$pdf->Ln();
//print barcode of uid
$pdf->StopTransform();
$pdf->setXY(0,0);
$pdf->StartTransform();
$pdf->SetTextColor(0,0,0);
$pdf->Rotate(-90,18,45);
$pdf->write1DBarcode($userinfo->uid, "C128A", '', '', 45, 4, 0.4,'', 'N');
$pdf->StopTransform();

I don't have to kill myself now

I was about to jump out the window after hours of debugging on this exact problem. Thanks! I'm sure the garbage men thank you also, the 23 floor fall would have made a big mess.

hello

Good work! Your post/article is an excellent example of why I keep comming back to read your excellent quality content that is forever updated. Thank you!

como rotar dentro de una tabla html

hola esta muy bien pero... ¿como puedo rotar texto dentro de una tabla html ?

hola

hola

si la tabla html esta un elemento, es imposible a rotar un elemento dentro la tabla, pero si las células de la tabla estan elementos individual su rote el texto como se describe