Posts

Showing posts from January, 2019

JQuery UI Autocomplete, custom HTML structure for result?

$( '#myAutocomplete' ).autocomplete( {     source: availableTags,     multiselect: true ,     open: function ( e, ui )     {         var             acData = $( this ).data( 'ui-autocomplete' ),             styledTerm = termTemplate.replace( '%s' , acData.term);         acData             .menu             .element             .find( 'div' )             .each( function ()             {                 var me = $( this );                 console .log(me);                 me.html(me.text().replace(acData.term,                     s...

iTextSharp–Add header/footer to PDF

Image
It’s a common requirement to have header/footer on PDF and it could be achieved using PageEvents in iTextSharp. It depends on the requirement, but in general header may contain: Header Title Header Subtitle Logo Page Number/Datetime And footer may contain: Page Number Copyright information Check out below function that creates sample PDF having five pages with header and footer: ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 private void CreatePDF() {      string fileName = string .Empty;        DateTime fileCreationDatetime = DateTime.Now;        fileName = string .Format( "{0}.pdf" , fileCreationDatetime.ToString( @"yyyyMMdd" ) + "_" + fileCreationDatetime.ToString( @"HHmm...