Created
September 11, 2012 19:34
-
-
Save thefrosty/3701418 to your computer and use it in GitHub Desktop.
Set badge location.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// http://www.avery.com/avery/en_us/Products/Name-Badges/Name-Badges/Insertable-Name-Badges_74459.htm (3" X 4") | |
// Add a page, but only on a multiple of 6 | |
if ( $counter == 1 || ( $counter % 7 == 0 ) ) { | |
$pdf->AddPage('P', 'Letter'); | |
$counter = 1; | |
} | |
// Set the co-ordinates for all items in each of the badges | |
switch ( $counter ) { | |
//Width: 101.6 - Height: 76.2 | |
case 1: | |
$background_x = 6.1; | |
$background_y = 25; | |
$avatar_x = 15; | |
$avatar_y = 51; | |
$text_x = 18; | |
$text_y = 96; | |
break; | |
case 2: | |
$background_x = 108.1; | |
$background_y = 25; | |
$avatar_x = 118.1; | |
$avatar_y = 51; | |
$text_x = 119.6; | |
$text_y = 96; | |
break; | |
case 3: | |
$background_x = 6.1; | |
$background_y = 101.6; | |
$avatar_x = 15; | |
$avatar_y = 128; | |
$text_x = 18; | |
$text_y = 172; | |
break; | |
case 4: | |
$background_x = 108.1; | |
$background_y = 101.6; | |
$avatar_x = 118.1; | |
$avatar_y = 128; | |
$text_x = 119.6; | |
$text_y = 172; | |
break; | |
case 5: | |
$background_x = 6.1; | |
$background_y = 178.2; | |
$avatar_x = 15; | |
$avatar_y = 205; | |
$text_x = 18; | |
$text_y = 250; | |
break; | |
case 6: | |
$background_x = 108.1; | |
$background_y = 178.2; | |
$avatar_x = 118.1; | |
$avatar_y = 205; | |
$text_x = 119.6; | |
$text_y = 250; | |
break; | |
} | |
?> |
I'd guess $counter % 7 == 1
would be causing the trouble. I'd try $counter % 6 == 0
Thanks. That didn't fix it, but $couter % 7 == 0
did!
Now since that caused an issue I need to output every 6th attendee.
for ( $i = 0; $i < count($attendee); $i++ ) {
}
Never mind that crap, going to just comment out attendee's array every 6th one and reprint those old ones.
I can look to see if I have the badge code I modified for last years WCLV.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Just figured out that my badges are printing 7 per page. Somehow number 7 is being added on top of number 6. Does any of this code say that?