| Line 20... |
Line 20... |
| 20 |
import com.itextpdf.text.DocumentException;
|
20 |
import com.itextpdf.text.DocumentException;
|
| 21 |
import com.itextpdf.text.Element;
|
21 |
import com.itextpdf.text.Element;
|
| 22 |
import com.itextpdf.text.Font;
|
22 |
import com.itextpdf.text.Font;
|
| 23 |
import com.itextpdf.text.Font.FontFamily;
|
23 |
import com.itextpdf.text.Font.FontFamily;
|
| 24 |
import com.itextpdf.text.Image;
|
24 |
import com.itextpdf.text.Image;
|
| 25 |
import com.itextpdf.text.PageSize;
|
- |
|
| 26 |
import com.itextpdf.text.Paragraph;
|
25 |
import com.itextpdf.text.Paragraph;
|
| 27 |
import com.itextpdf.text.Phrase;
|
26 |
import com.itextpdf.text.Phrase;
|
| 28 |
import com.itextpdf.text.Rectangle;
|
27 |
import com.itextpdf.text.Rectangle;
|
| 29 |
import com.itextpdf.text.pdf.PdfContentByte;
|
28 |
import com.itextpdf.text.pdf.PdfContentByte;
|
| 30 |
import com.itextpdf.text.pdf.PdfGState;
|
29 |
import com.itextpdf.text.pdf.PdfGState;
|
| 31 |
import com.itextpdf.text.pdf.PdfPCell;
|
30 |
import com.itextpdf.text.pdf.PdfPCell;
|
| 32 |
import com.itextpdf.text.pdf.PdfPTable;
|
31 |
import com.itextpdf.text.pdf.PdfPTable;
|
| 33 |
import com.itextpdf.text.pdf.PdfReader;
|
32 |
import com.itextpdf.text.pdf.PdfReader;
|
| 34 |
import com.itextpdf.text.pdf.PdfStamper;
|
33 |
import com.itextpdf.text.pdf.PdfStamper;
|
| 35 |
import com.itextpdf.text.pdf.PdfWriter;
|
34 |
import com.itextpdf.text.pdf.PdfWriter;
|
| 36 |
import com.microsoft.schemas.office.visio.x2012.main.PagesDocument;
|
- |
|
| 37 |
import com.spice.profitmandi.common.model.CreditNotePdfModel;
|
35 |
import com.spice.profitmandi.common.model.CreditNotePdfModel;
|
| 38 |
import com.spice.profitmandi.common.model.CustomCustomer;
|
36 |
import com.spice.profitmandi.common.model.CustomCustomer;
|
| 39 |
import com.spice.profitmandi.common.model.CustomInsurancePolicy;
|
37 |
import com.spice.profitmandi.common.model.CustomInsurancePolicy;
|
| 40 |
import com.spice.profitmandi.common.model.CustomOrderItem;
|
38 |
import com.spice.profitmandi.common.model.CustomOrderItem;
|
| 41 |
import com.spice.profitmandi.common.model.CustomPaymentOption;
|
39 |
import com.spice.profitmandi.common.model.CustomPaymentOption;
|
| Line 260... |
Line 258... |
| 260 |
sgstTotalAmount = sgstTotalAmount + insurancePolicy.getSgstAmount();
|
258 |
sgstTotalAmount = sgstTotalAmount + insurancePolicy.getSgstAmount();
|
| 261 |
}
|
259 |
}
|
| 262 |
orders.addCell(new Paragraph(String.format("%.0f", insurancePolicy.getNetAmount()), FONT_NORMAL));
|
260 |
orders.addCell(new Paragraph(String.format("%.0f", insurancePolicy.getNetAmount()), FONT_NORMAL));
|
| 263 |
}
|
261 |
}
|
| 264 |
Rectangle rectangle = document.getPageSize();
|
262 |
Rectangle rectangle = document.getPageSize();
|
| 265 |
iconImg.setAbsolutePosition(50, rectangle.getHeight()-90);
|
263 |
iconImg.setAbsolutePosition(50, rectangle.getHeight() - 60);
|
| 266 |
iconImg.scalePercent(50);
|
264 |
iconImg.scalePercent(20);
|
| 267 |
document.add(iconImg);
|
265 |
document.add(iconImg);
|
| 268 |
document.add(paragraphTitle);
|
266 |
document.add(paragraphTitle);
|
| 269 |
document.add(Chunk.NEWLINE);
|
267 |
document.add(Chunk.NEWLINE);
|
| 270 |
document.add(Chunk.NEWLINE);
|
268 |
document.add(Chunk.NEWLINE);
|
| 271 |
document.add(tableCustomerRetailer);
|
269 |
document.add(tableCustomerRetailer);
|
| Line 382... |
Line 380... |
| 382 |
Phrase p = new Phrase("My watermark (text)", f);
|
380 |
Phrase p = new Phrase("My watermark (text)", f);
|
| 383 |
URL cancelledImgUrl = PdfUtils.class.getClassLoader().getResource("cancelled.png");
|
381 |
URL cancelledImgUrl = PdfUtils.class.getClassLoader().getResource("cancelled.png");
|
| 384 |
URL waterMarkImgUrl = PdfUtils.class.getClassLoader().getResource("sd1.jpg");
|
382 |
URL waterMarkImgUrl = PdfUtils.class.getClassLoader().getResource("sd1.jpg");
|
| 385 |
Image imgCancelled = Image.getInstance(cancelledImgUrl);
|
383 |
Image imgCancelled = Image.getInstance(cancelledImgUrl);
|
| 386 |
Image imgWatermark = Image.getInstance(waterMarkImgUrl);
|
384 |
Image imgWatermark = Image.getInstance(waterMarkImgUrl);
|
| 387 |
imgWatermark.scaleAbsolute(imgWatermark.getScaledWidth()*2, imgWatermark.getScaledHeight()*2);
|
385 |
imgWatermark.scaleAbsolute(imgWatermark.getScaledWidth() * 2.5f, imgWatermark.getScaledHeight() * 2.5f);
|
| 388 |
float w = imgCancelled.getScaledWidth() / 2;
|
386 |
float w = imgCancelled.getScaledWidth() / 2;
|
| 389 |
float h = imgCancelled.getScaledHeight() / 2;
|
387 |
float h = imgCancelled.getScaledHeight() / 2;
|
| 390 |
float wWaterMark = imgWatermark.getScaledWidth() / 2;
|
388 |
float wWaterMark = imgWatermark.getScaledWidth() / 2;
|
| 391 |
float hWatermark = imgWatermark.getScaledHeight() / 2;
|
389 |
float hWatermark = imgWatermark.getScaledHeight() / 2;
|
| 392 |
// transparency
|
390 |
// transparency
|
| 393 |
PdfGState gs1 = new PdfGState();
|
391 |
PdfGState gs1 = new PdfGState();
|
| 394 |
gs1.setFillOpacity(0.5f);
|
392 |
gs1.setFillOpacity(0.5f);
|
| 395 |
PdfGState gs2 = new PdfGState();
|
393 |
PdfGState gs2 = new PdfGState();
|
| 396 |
gs2.setFillOpacity(0.25f);
|
394 |
gs2.setFillOpacity(0.2f);
|
| 397 |
// properties
|
395 |
// properties
|
| 398 |
PdfContentByte over;
|
396 |
PdfContentByte over;
|
| 399 |
Rectangle pagesize;
|
397 |
Rectangle pagesize;
|
| 400 |
float x, y;
|
398 |
float x, y;
|
| 401 |
|
399 |
|