Package org.eclipse.birt.report.engine.api

Examples of org.eclipse.birt.report.engine.api.PDFRenderOption


            htmlOptions.setImageDirectory(birtImageDirectory);
            htmlOptions.setBaseImageURL(birtImageDirectory);
            options.setImageHandler(imageHandler);
        } else if (options.getOutputFormat().equalsIgnoreCase(RenderOption.OUTPUT_FORMAT_PDF)) {
            // set pdf render options
            PDFRenderOption pdfOptions = new PDFRenderOption(options);
            pdfOptions.setOption(IPDFRenderOption.PAGE_OVERFLOW, Boolean.TRUE );
        } else if (options.getOutputFormat().equalsIgnoreCase("xls")) {
            // set excel render options
            new EXCELRenderOption(options);
        }
        options.setOutputStream(output);
View Full Code Here


            options.setImageHandler(imageHandler);
        } else if ("application/postscript".equalsIgnoreCase(contentType)) { // Post Script
            options.setOutputFormat("postscript");
        } else if ("application/pdf".equalsIgnoreCase(contentType)) { // PDF
            options.setOutputFormat(RenderOption.OUTPUT_FORMAT_PDF);
            PDFRenderOption pdfOptions = new PDFRenderOption(options);
            pdfOptions.setOption(IPDFRenderOption.PAGE_OVERFLOW, Boolean.TRUE );
        } else if ("application/vnd.ms-word".equalsIgnoreCase(contentType)) { // MS Word
            options.setOutputFormat("doc");
        else if ("application/vnd.ms-excel".equalsIgnoreCase(contentType)) { // MS Excel
            options.setOutputFormat("xls");
            new EXCELRenderOption(options);
View Full Code Here

    IReportDocument rptdoc = engine.openReportDocument(document.getAbsolutePath());

    // Create Render Task
    IRenderTask renderTask = engine.createRenderTask(rptdoc);

    PDFRenderOption optionsPDF = new PDFRenderOption();
    optionsPDF.setOutputFileName("D:/Temp/output.pdf");
    optionsPDF.setOutputFormat(HTMLRenderOption.OUTPUT_FORMAT_PDF);
    renderTask.setRenderOption(optionsPDF);

    // render
    renderTask.render();
View Full Code Here

        .openReportDocument("D:/Temp/TOCTest.rptdocument");

    // Create Render Task
    IRenderTask rtask = engine.createRenderTask(rptdoc);

    PDFRenderOption optionsPDF = new PDFRenderOption();
    optionsPDF.setOutputFileName("D:/Temp/output.pdf");
    optionsPDF.setOutputFormat(HTMLRenderOption.OUTPUT_FORMAT_PDF);
    rtask.setRenderOption(optionsPDF);

    // render
    rtask.render();
View Full Code Here

            htmlOptions.setImageDirectory(birtImageDirectory);
            htmlOptions.setBaseImageURL(birtImageDirectory);
            options.setImageHandler(imageHandler);
        } else if (options.getOutputFormat().equalsIgnoreCase(RenderOption.OUTPUT_FORMAT_PDF)) {
            // set pdf render options
            PDFRenderOption pdfOptions = new PDFRenderOption(options);
            pdfOptions.setOption(IPDFRenderOption.PAGE_OVERFLOW, Boolean.TRUE );
        } else if (options.getOutputFormat().equalsIgnoreCase("xls")) {
            // set excel render options
            EXCELRenderOption excelOptions = new EXCELRenderOption(options);
        }
        options.setOutputStream(output);
View Full Code Here

    if (templateFileName == null || templateFileName.trim().equals(""))
      templateFileName = "report";
    IRenderOption renderOption = null;

    if (outputFormat != null && outputFormat.equalsIgnoreCase(IBirtConstants.PDF_RENDER_FORMAT)) {
      renderOption = new PDFRenderOption();
      renderOption.setOutputFormat(IBirtConstants.PDF_RENDER_FORMAT);
      //renderOption.setSupportedImageFormats("JPG;jpg;PNG;png;BMP;bmp;SVG;svg;GIF;gif");
      response.setContentType("application/pdf");
      response.setHeader("Content-disposition", "inline; filename=" + templateFileName + ".pdf");     
    } else if (outputFormat != null && outputFormat.equalsIgnoreCase(IBirtConstants.HTML_RENDER_FORMAT)) {
      renderOption = prepareHtmlRenderOption(servletContext, request);
      renderOption.setOutputFormat(IBirtConstants.HTML_RENDER_FORMAT);
      response.setHeader("Content-Type", "text/html");
      response.setContentType("text/html");
    } else if (outputFormat != null && outputFormat.equalsIgnoreCase(IBirtConstants.DOC_RENDER_FORMAT)) {
      renderOption = prepareHtmlRenderOption(servletContext, request);
      renderOption.setOutputFormat(IBirtConstants.DOC_RENDER_FORMAT);
      // renderOption.setOutputFileName(templateFileName + ".doc");
      response.setContentType("application/msword");
      response.setHeader("Content-disposition", "inline; filename=" + templateFileName + ".doc");
    } else if (outputFormat != null && outputFormat.equalsIgnoreCase(RTF_FORMAT)) {
      renderOption = prepareHtmlRenderOption(servletContext, request);
      renderOption.setOutputFormat(RTF_FORMAT);
      response.setContentType("application/rtf");
      response.setHeader("Content-disposition", "inline; filename=" + templateFileName + ".rtf");
    } else if (outputFormat != null && outputFormat.equalsIgnoreCase("xls")) {
      renderOption = prepareHtmlRenderOption(servletContext, request);
      renderOption.setOutputFormat("xls");
      // renderOption.setOutputFileName(templateFileName + ".xls");
      response.setContentType("application/vnd.ms-excel");
      response.setHeader("Content-disposition", "inline; filename=" + templateFileName + ".xls");
    } else if (outputFormat != null && outputFormat.equalsIgnoreCase("ppt")) {
      renderOption = prepareHtmlRenderOption(servletContext, request);
      renderOption.setOutputFormat("ppt");
      // renderOption.setOutputFileName(templateFileName + ".ppt");
      response.setContentType("application/vnd.ms-powerpoint");
      response.setHeader("Content-disposition", "inline; filename=" + templateFileName + ".ppt");
    } else if (outputFormat != null && outputFormat.equalsIgnoreCase(IBirtConstants.POSTSCRIPT_RENDER_FORMAT)) {
      renderOption = new PDFRenderOption();
      renderOption.setOutputFormat(IBirtConstants.POSTSCRIPT_RENDER_FORMAT);
      // renderOption.setOutputFileName(templateFileName + ".ps");
      response.setHeader("Content-disposition", "inline; filename=" + templateFileName + ".ps");
    } else if (outputFormat != null && outputFormat.equalsIgnoreCase(DataExtractionParameterUtil.EXTRACTION_FORMAT_CSV)) {
      logger.debug(" Output format parameter is CSV. Create document obj .");
View Full Code Here

TOP

Related Classes of org.eclipse.birt.report.engine.api.PDFRenderOption

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.