@Override protected final void renderMergedOutputModel( Map<String, Object> model, HttpServletRequest request, HttpServletResponse response) throws Exception { // IE workaround: write into byte array first. ByteArrayOutputStream baos = createTemporaryOutputStream(); PdfReader reader = readPdfResource(); PdfStamper stamper = new PdfStamper(reader, baos); mergePdfDocument(model, stamper, request, response); stamper.close(); // Flush to HTTP response. writeToResponse(response, baos); }
/** * Read the raw PDF resource into an iText PdfReader. * <p>The default implementation resolve the specified "url" property * as ApplicationContext resource. * @return the PdfReader instance * @throws IOException if resource access failed * @see #setUrl */ protected PdfReader readPdfResource() throws IOException { String url = getUrl(); Assert.state(url != null, "'url' not set"); return new PdfReader(obtainApplicationContext().getResource(url).getInputStream()); }
public AbstractPdfStamperView(){ setContentType("application/pdf"); }
/** * Read the raw PDF resource into an iText PdfReader. * <p>The default implementation resolve the specified "url" property * as ApplicationContext resource. * @return the PdfReader instance * @throws IOException if resource access failed * @see #setUrl */ protected PdfReader readPdfResource() throws IOException { return new PdfReader(getApplicationContext().getResource(getUrl()).getInputStream()); }
@Override protected final void renderMergedOutputModel( Map<String, Object> model, HttpServletRequest request, HttpServletResponse response) throws Exception { // IE workaround: write into byte array first. ByteArrayOutputStream baos = createTemporaryOutputStream(); PdfReader reader = readPdfResource(); PdfStamper stamper = new PdfStamper(reader, baos); mergePdfDocument(model, stamper, request, response); stamper.close(); // Flush to HTTP response. writeToResponse(response, baos); }
/** * Read the raw PDF resource into an iText PdfReader. * <p>The default implementation resolve the specified "url" property * as ApplicationContext resource. * @return the PdfReader instance * @throws IOException if resource access failed * @see #setUrl */ protected PdfReader readPdfResource() throws IOException { String url = getUrl(); Assert.state(url != null, "'url' not set"); return new PdfReader(obtainApplicationContext().getResource(url).getInputStream()); }
public AbstractPdfStamperView(){ setContentType("application/pdf"); }
@Override protected final void renderMergedOutputModel( Map<String, Object> model, HttpServletRequest request, HttpServletResponse response) throws Exception { // IE workaround: write into byte array first. ByteArrayOutputStream baos = createTemporaryOutputStream(); PdfReader reader = readPdfResource(); PdfStamper stamper = new PdfStamper(reader, baos); mergePdfDocument(model, stamper, request, response); stamper.close(); // Flush to HTTP response. writeToResponse(response, baos); }
public AbstractPdfStamperView(){ setContentType("application/pdf"); }