Package org.geomajas.plugin.printing.configuration

Examples of org.geomajas.plugin.printing.configuration.PrintTemplate


  private final Logger log = LoggerFactory.getLogger(PrintServiceImplTest.class);

  @Before
  public void loadTemplates() throws Exception {
    PrintTemplate template = printService.createDefaultTemplate("A4", true);
    template.setName("test");
    printService.saveOrUpdateTemplate(template);
    log.info(template.getPageXml());

  }
View Full Code Here


    }
    LegendComponent comp = (LegendComponent) printDtoService.toInternal(legend);
    PageComponentImpl page = new PageComponentImpl();
    page.setSize("0 0", false);
    page.addComponent(comp);
    PrintTemplate template = new PrintTemplate();
    template.setPage(page);
    SinglePageDocument pdfDoc = new SinglePageDocument(page, null);
    FileOutputStream fo = new FileOutputStream("target/legend.png");
    pdfDoc.render(fo, Format.PNG);
    fo.flush();
    fo.close();
View Full Code Here

    });
    return allTemplates;
  }

  public PrintTemplate createDefaultTemplate(String pagesize, boolean landscape) throws PrintingException {
    PrintTemplate template = createTemplate(pagesize, landscape);
    // calculate the sizes (if not already calculated !)
    SinglePageDocument document = new SinglePageDocument(template.getPage(), null);
    try {
      document.layout(Format.PDF);
    } catch (PrintingException e) {
      // should not happen !
      log.warn("Unexpected problem while laying out default print template", e);
View Full Code Here

    map.addComponent(bar);
    map.addComponent(legend);
    map.addComponent(northarrow);
    page.addComponent(map);
    page.addComponent(title);
    PrintTemplate template = new PrintTemplate(true);
    template.setName("Default" + "-" + pageSize + "-" + (landscape ? "landscape" : "portrait"));
    template.setPage(page);
    return template;
  }
View Full Code Here

TOP

Related Classes of org.geomajas.plugin.printing.configuration.PrintTemplate

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.