Examples of XFAHelper


Examples of flex.acrobat.pdf.XFAHelper

    public Object generatePDF(Document dataset) throws IOException
    {
      
        // Open shell PDF based on the servlet context (in this case, webapp root)
        String source = FlexContext.getServletContext().getRealPath("/pdfgen_contact/contact.pdf");
        XFAHelper helper = new XFAHelper();
        helper.open(source);

        // Import XFA dataset
        helper.importDataset(dataset);

        // Save new PDF as a byte array in the current session
        byte[] bytes = helper.saveToByteArray();
        String uuid = UUIDUtils.createUUID();
        FlexSession session = FlexContext.getFlexSession();
        session.setAttribute(uuid, bytes);

        // Close any resources
        helper.close();

        HttpServletRequest req = FlexContext.getHttpRequest();
        String contextRoot = "/lcds-samples";
        if (req != null)
            contextRoot = req.getContextPath();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.