com.infinity.controller.PDFView.java Source code

Java tutorial

Introduction

Here is the source code for com.infinity.controller.PDFView.java

Source

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.infinity.controller;

import com.lowagie.text.Document;
import com.lowagie.text.Paragraph;
import com.lowagie.text.pdf.PdfWriter;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.web.servlet.view.document.AbstractPdfView;

/**
 *
 * @author t311372
 */
public class PDFView extends AbstractPdfView {

    @Override
    protected void buildPdfDocument(Map<String, Object> map, Document dcmnt, PdfWriter writer,
            HttpServletRequest hsr, HttpServletResponse hsr1) throws Exception {

        List words = (List) map.get("wordList");
        for (Object word : words) {
            dcmnt.add(new Paragraph((String) word));
        }
    }

}