Subversion Repositories SmartDukaan

Rev

Rev 8082 | Rev 8091 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 8082 Rev 8090
Line 355... Line 355...
355
		logoTable.getDefaultCell().setHorizontalAlignment(Element.ALIGN_RIGHT);
355
		logoTable.getDefaultCell().setHorizontalAlignment(Element.ALIGN_RIGHT);
356
		logoTable.getDefaultCell().setVerticalAlignment(Element.ALIGN_BOTTOM);
356
		logoTable.getDefaultCell().setVerticalAlignment(Element.ALIGN_BOTTOM);
357
		
357
		
358
		PdfPCell logoCell;
358
		PdfPCell logoCell;
359
		String logoPath;
359
		String logoPath;
360
		
-
 
-
 
360
		System.out.println("Order Source Value........."+order.getSource());
361
		if(order.getSource() == OrderSource.STORE.getValue()){
361
		if(order.getSource() == OrderSource.STORE.getValue()){
362
			logoCell = new PdfPCell(new Phrase(""));
362
			logoCell = new PdfPCell(new Phrase(""));
363
			
363
			
364
			logoCell.setBorder(Rectangle.NO_BORDER);
-
 
365
			logoCell.setHorizontalAlignment(Element.ALIGN_LEFT);
-
 
366
			
-
 
367
			logoTable.addCell(logoCell);
-
 
368
		}else{
364
		}else{
369
			logoPath = InvoiceGenerationService.class.getResource("/logo.jpg").getPath();
365
			logoPath = InvoiceGenerationService.class.getResource("/logo.jpg").getPath();
370
			
-
 
-
 
366
			System.out.println("Logo Path........."+logoPath);
371
			try {
367
			try {
372
				logoCell = new PdfPCell(Image.getInstance(logoPath), false);
368
				logoCell = new PdfPCell(Image.getInstance(logoPath), false);
373
			} catch (Exception e) {
369
			} catch (Exception e) {
374
				//Too Many exceptions to catch here: BadElementException, MalformedURLException and IOException
370
				//Too Many exceptions to catch here: BadElementException, MalformedURLException and IOException
375
				logger.warn("Couldn't load the Saholic logo: ", e);
371
				logger.warn("Couldn't load the Saholic logo: ", e);
376
				logoCell = new PdfPCell(new Phrase("Saholic Logo"));
372
				logoCell = new PdfPCell(new Phrase("Saholic Logo"));
377
			}
373
			}
378
			logoCell.setBorder(Rectangle.NO_BORDER);
-
 
379
			logoCell.setHorizontalAlignment(Element.ALIGN_LEFT);
-
 
380
			
-
 
381
			logoTable.addCell(logoCell);
-
 
382
		
374
		
383
		}
375
		}
-
 
376
		logoCell.setBorder(Rectangle.NO_BORDER);
-
 
377
		logoCell.setHorizontalAlignment(Element.ALIGN_LEFT);
-
 
378
		
-
 
379
		logoTable.addCell(logoCell);
384
	}
380
	}
385
 
381
 
386
	private Font getBarCodeFont(Provider provider, float barcodeFontSize) {
382
	private Font getBarCodeFont(Provider provider, float barcodeFontSize) {
387
		String fontPath = InvoiceGenerationService.class.getResource("/" + provider.getName().toLowerCase() + "/barcode.TTF").getPath();
383
		String fontPath = InvoiceGenerationService.class.getResource("/" + provider.getName().toLowerCase() + "/barcode.TTF").getPath();
388
		FontFactoryImp ttfFontFactory = new FontFactoryImp();
384
		FontFactoryImp ttfFontFactory = new FontFactoryImp();