js/decklist/main.js
// Generates the part of the PDF that never changes (lines, boxes, etc.)
Generates the part of the PDF that never changes (lines, boxes, etc.)
Generates the part of the PDF that never changes ( lines boxes etc . )
function generateDecklistLayout() {
  var dl = new jsPDF('portrait', 'pt', 'letter');
  dl.addImage(logo, 'JPEG', 27, 54, 90, 32);
  dl.setLineWidth(1);
  dl.rect(135, 54, 441, 24);  
  dl.rect(135, 78, 441, 24);  
  dl.rect(355, 54, 221, 72);  
  dl.rect(552, 30, 24, 24);   
  dl.rect(445, 30, 55, 24);   
  dl.rect(27, 140, 24, 628);  
  dl.rect(27, 140, 24, 270);  
  dl.rect(27, 140, 24, 449);  
  dl.rect(250, 748, 56, 22); 
  dl.rect(524, 694, 56, 22); 
  dl.rect(320, 722, 260, 48); 
  dl.setLineWidth(.5);
  dl.rect(135, 54, 54, 48);   
  dl.rect(355, 54, 54, 72);   
  dl.rect(320, 722, 130, 48); 
  dl.rect(320, 722, 260, 12); 
  dl.rect(320, 734, 260, 12); 
  dl.rect(320, 746, 260, 12); 
  var y = 140;
  while (y < 380) {
    dl.rect(27, y, 24, 24);   digits
    y = y + 24;
  }
  dl.setFontSize(15);
  dl.setFontStyle('bold');
  dl.setFont('times'); 
  dl.text('DECK REGISTRATION SHEET', 135, 45);
  dl.setFontSize(13);
  dl.text('PRINT CLEARLY USING ENGLISH CARD NAMES', 36, 121);
  dl.setFontSize(13);
  dl.text('Main Deck:', 62, 149);
  dl.text('Main Deck Continued:', 336, 149);
  dl.text('Sideboard:', 336, 404);
  dl.setFontSize(11);
  dl.text('# in deck:', 62, 166);  
  dl.text('Card Name:', 122, 166);
  dl.text('# in deck:', 336, 166); 
  dl.text('Card Name:', 396, 166);
  dl.text('# in deck:', 336, 420); 
  dl.text('Card Name:', 396, 420);
  dl.text('Total Number of Cards in Main Deck:', 62, 768);
  dl.text('Total Number of Cards in Sideboard:', 336, 714);
  dl.setFontSize(7);
  dl.setFontStyle('normal');
  dl.text('Table', 421, 40);
  dl.text('Number', 417, 48);
  dl.text('First Letter of', 508, 40);
  dl.text('Last Name', 516, 48);
  dl.text('Date:', 169, 68);
  dl.text('Event:', 387, 68);
  dl.text('Location:', 158, 92);
  dl.text('Deck Name:', 370, 92);
  dl.text('Deck Designer:', 362, 116);
  dl.text('First Name:', 41, 581, 90);  
  dl.text('Last Name:', 41, 760, 90);
  dl.setFontStyle('italic');
  dl.text('DCI #:', 41, 404, 90)     # is rotated and italic
  dl.setFontSize(6);
  dl.setFontStyle('normal');
  dl.text('Deck Check Rd #:', 324, 742); 
  dl.text('Status:', 324, 754);
  dl.text('Judge:', 324, 766);
  dl.text('Main/SB:', 454, 730);        
  dl.text('/', 520, 730);
  dl.text('Deck Check Rd #:', 454, 742);
  dl.text('Status:', 454, 754);
  dl.text('Judge:', 454, 766);
  dl.setFontSize(5);
  dl.setFontStyle('bold');
  dl.text('FOR OFFICAL USE ONLY', 324, 730);
  y = 186;
  while(y < 750)                  
  {
    dl.line(62, y, 106, y);
    dl.line(116, y, 306, y);
    y = y + 18;
  }
  y = 186;
  while(y < 386)                  
  {
    dl.line(336, y, 380, y);
    dl.line(390, y, 580, y);
    y = y + 18;
  }
  y = 438;
  while(y < 696)                  
  {
    dl.line(336, y, 380, y);
    dl.line(390, y, 580, y);
    y = y + 18;
  }
  return (dl);
}
function generateDecklistLayout ( ) { var dl = new jsPDF ( 'portrait' , 'pt' , 'letter' ) ; dl . addImage ( logo , 'JPEG' , 27 , 54 , 90 , 32 ) ; dl . setLineWidth ( 1 ) ; dl . rect ( 135 , 54 , 441 , 24 ) ; dl . rect ( 135 , 78 , 441 , 24 ) ; dl . rect ( 355 , 54 , 221 , 72 ) ; dl . rect ( 552 , 30 , 24 , 24 ) ; dl . rect ( 445 , 30 , 55 , 24 ) ; dl . rect ( 27 , 140 , 24 , 628 ) ; dl . rect ( 27 , 140 , 24 , 270 ) ; dl . rect ( 27 , 140 , 24 , 449 ) ; dl . rect ( 250 , 748 , 56 , 22 ) ; dl . rect ( 524 , 694 , 56 , 22 ) ; dl . rect ( 320 , 722 , 260 , 48 ) ; dl . setLineWidth ( .5 ) ; dl . rect ( 135 , 54 , 54 , 48 ) ; dl . rect ( 355 , 54 , 54 , 72 ) ; dl . rect ( 320 , 722 , 130 , 48 ) ; dl . rect ( 320 , 722 , 260 , 12 ) ; dl . rect ( 320 , 734 , 260 , 12 ) ; dl . rect ( 320 , 746 , 260 , 12 ) ; var y = 140 ; while ( y < 380 ) { dl . rect ( 27 , y , 24 , 24 ) ; y = y + 24 ; } dl . setFontSize ( 15 ) ; dl . setFontStyle ( 'bold' ) ; dl . setFont ( 'times' ) ; dl . text ( 'DECK REGISTRATION SHEET' , 135 , 45 ) ; dl . setFontSize ( 13 ) ; dl . text ( 'PRINT CLEARLY USING ENGLISH CARD NAMES' , 36 , 121 ) ; dl . setFontSize ( 13 ) ; dl . text ( 'Main Deck:' , 62 , 149 ) ; dl . text ( 'Main Deck Continued:' , 336 , 149 ) ; dl . text ( 'Sideboard:' , 336 , 404 ) ; dl . setFontSize ( 11 ) ; dl . text ( '# in deck:' , 62 , 166 ) ; dl . text ( 'Card Name:' , 122 , 166 ) ; dl . text ( '# in deck:' , 336 , 166 ) ; dl . text ( 'Card Name:' , 396 , 166 ) ; dl . text ( '# in deck:' , 336 , 420 ) ; dl . text ( 'Card Name:' , 396 , 420 ) ; dl . text ( 'Total Number of Cards in Main Deck:' , 62 , 768 ) ; dl . text ( 'Total Number of Cards in Sideboard:' , 336 , 714 ) ; dl . setFontSize ( 7 ) ; dl . setFontStyle ( 'normal' ) ; dl . text ( 'Table' , 421 , 40 ) ; dl . text ( 'Number' , 417 , 48 ) ; dl . text ( 'First Letter of' , 508 , 40 ) ; dl . text ( 'Last Name' , 516 , 48 ) ; dl . text ( 'Date:' , 169 , 68 ) ; dl . text ( 'Event:' , 387 , 68 ) ; dl . text ( 'Location:' , 158 , 92 ) ; dl . text ( 'Deck Name:' , 370 , 92 ) ; dl . text ( 'Deck Designer:' , 362 , 116 ) ; dl . text ( 'First Name:' , 41 , 581 , 90 ) ; dl . text ( 'Last Name:' , 41 , 760 , 90 ) ; dl . setFontStyle ( 'italic' ) ; dl . text ( 'DCI #:' , 41 , 404 , 90 ) dl . setFontSize ( 6 ) ; dl . setFontStyle ( 'normal' ) ; dl . text ( 'Deck Check Rd #:' , 324 , 742 ) ; dl . text ( 'Status:' , 324 , 754 ) ; dl . text ( 'Judge:' , 324 , 766 ) ; dl . text ( 'Main/SB:' , 454 , 730 ) ; dl . text ( '/' , 520 , 730 ) ; dl . text ( 'Deck Check Rd #:' , 454 , 742 ) ; dl . text ( 'Status:' , 454 , 754 ) ; dl . text ( 'Judge:' , 454 , 766 ) ; dl . setFontSize ( 5 ) ; dl . setFontStyle ( 'bold' ) ; dl . text ( 'FOR OFFICAL USE ONLY' , 324 , 730 ) ; y = 186 ; while ( y < 750 ) { dl . line ( 62 , y , 106 , y ) ; dl . line ( 116 , y , 306 , y ) ; y = y + 18 ; } y = 186 ; while ( y < 386 ) { dl . line ( 336 , y , 380 , y ) ; dl . line ( 390 , y , 580 , y ) ; y = y + 18 ; } y = 438 ; while ( y < 696 ) { dl . line ( 336 , y , 380 , y ) ; dl . line ( 390 , y , 580 , y ) ; y = y + 18 ; } return ( dl ) ; }
Generates the part of the PDF that never changes (lines, boxes, etc.)
Generates the part of the PDF that never changes ( lines boxes etc . )
// Create a new dl // Add the logo // Create all the rectangles // Start with the top box, for deck designer, name, etc. // date + event // location + deck name // event + deck name + deck designer // first letter // table number // last name + first name + dci // dci // first name + dci // total number main deck // total number side deck // judge box // date + location // event + deck name + deck designer // official use + dc round + status + judge // official use + main/sb // dc round + dc round // status + status // dci digits // Get all the various notes down on the page // There are a ton of them, so this will be exciting // it's no Helvetica, that's for sure // first row, main deck // second row, main deck // second row, sideboard // rotate // dci # is rotated and italic // first row // second row // Now let's create a bunch of lines for putting cards on // first column of lines // second column of lines (main deck) // second column of lines (main deck)