@@ -627,7 +627,12 @@ export default {
627627 footer: {
628628 font: ' FiraSans' ,
629629 fontSize: 8 ,
630- margin: [ 0 , 30 , 0 , 0 ]
630+ margin: [ 0 , 20 , 0 , 0 ]
631+ },
632+ qr: {
633+ font: ' FiraMono' ,
634+ fontSize: 8 ,
635+ alignment: ' right'
631636 }
632637 }
633638 };
@@ -665,12 +670,12 @@ export default {
665670 ];
666671 },
667672 getPdfSongsheets () {
668- var sheets = [];
673+ let sheets = [];
669674 for (const key in this .setlist .songs ) {
670675 if (this .setlist .songs .hasOwnProperty (key) && this .setlist .songs [key].id in this .songs ) {
671676 const song = this .songs [this .setlist .songs [key].id ];
672677 // handle song content parts
673- var content = [];
678+ let content = [];
674679 let parts = this .parsedContent (
675680 song .content ,
676681 song .customTuning ? song .customTuningDelta : 0 ,
@@ -702,7 +707,31 @@ export default {
702707 });
703708 }
704709 });
705- var meta = [
710+ // create footer
711+ let footer = [{
712+ // imprint with ccli#, author names and (c) year publisher
713+ width: ' *' ,
714+ style: ' footer' ,
715+ text: [
716+ song .note ? this .$t (' field.note' ) + ' :\n ' + song .note + ' \n\n ' : ' ' ,
717+ song .ccli ? ' CCLI Song Nr.: ' + song .ccli + ' \n ' : ' ' ,
718+ song .authors ? song .authors + ' \n ' : ' ' ,
719+ ' \u00A9 ' + (song .year ? song .year + ' ' : ' ' ) + song .publisher
720+ ]
721+ }];
722+ if (song .youtube ) {
723+ footer .push ({
724+ // QR code for YouTube link
725+ width: ' 140' ,
726+ margin: [ 0 , 20 , 0 , 0 ],
727+ stack: [
728+ { text: ' https://youtu.be/' + song .youtube , style: ' qr' },
729+ { qr: ' https://youtu.be/' + song .youtube , fit: ' 90' , style: ' qr' , margin: [ 0 , 5 , 0 , 0 ] }
730+ ]
731+ });
732+ }
733+ // put songsheet together
734+ let songsheet = [
706735 // song title [tuning] with a line beneath
707736 { text: song .title .toUpperCase (), style: ' header' },
708737 { canvas: [{ type: ' line' , x1: 0 , y1: 0 , x2: 505 , y2: 0 , lineWidth: .5 }] },
@@ -713,22 +742,13 @@ export default {
713742 margin: [ 0 , 4 , 0 , 0 ]
714743 },
715744 content,
716- // footer with ccli#, author names and (c) year publisher
717- {
718- text: [
719- song .note ? this .$t (' field.note' ) + ' :\n ' + song .note + ' \n\n ' : ' ' ,
720- song .ccli ? ' CCLI Song Nr.: ' + song .ccli + ' \n ' : ' ' ,
721- song .authors ? song .authors + ' \n ' : ' ' ,
722- ' \u00A9 ' + (song .year ? song .year + ' ' : ' ' ) + song .publisher
723- ],
724- style: ' footer'
725- }
745+ { columnGap: 8 , columns: footer }
726746 ];
727747 // add page break after every song exept for the last
728748 if (this .setlist .songs .length > 0 && key < this .setlist .songs .length - 1 ) {
729- meta .push ({ text: ' ' , pageBreak: ' after' , style: ' code' });
749+ songsheet .push ({ text: ' ' , pageBreak: ' after' , style: ' code' });
730750 }
731- sheets = sheets .concat (meta );
751+ sheets = sheets .concat (songsheet );
732752 }
733753 }
734754 return sheets;
0 commit comments