response.setContentType("application/pdf");
id = Long.valueOf(request.getParameter("id"));
Invoice invoice = invoiceManager.get(id);
InvoiceFormatToPdf pdf = new InvoiceFormatToPdf();
pdf.write(invoice, response.getOutputStream());
response.getOutputStream().close();
}
if (myType.equals("quotation")) {
response.setContentType("application/pdf");
id = Long.valueOf(request.getParameter("id"));
Quotation quotation = quotationManager.get(id);
QuotationToPdf pdf = new QuotationToPdf();
pdf.write(quotation, response.getOutputStream());
response.getOutputStream().close();
}
if (myType.equals("receipt")) {
response.setContentType("application/pdf");
id = Long.valueOf(request.getParameter("id"));
Payment payment = paymentManager.get(id);
ReceiptFormatToPdf pdf = new ReceiptFormatToPdf();
pdf.write(payment, response.getOutputStream());
response.getOutputStream().close();
}
}