Package flex.acrobat.pdf

Examples of flex.acrobat.pdf.XDPXFAHelper


    public Object generatePDF(Document dataset) throws IOException
    {
        // Open shell XDP containing XFA template based on servlet context (in this case webapp root)
        String source = FlexContext.getServletContext().getRealPath("/pdfgen_contact/contact.xdp");
        XDPXFAHelper helper = new XDPXFAHelper();
        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

Related Classes of flex.acrobat.pdf.XDPXFAHelper

Copyright © 2018 www.massapicom. 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.