Package org.geomajas.plugin.printing.component.impl

Examples of org.geomajas.plugin.printing.component.impl.PageComponentImpl


        item.addChild(legendLabel);
        legend.addChild(item);
      }
    }
    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);
View Full Code Here


    allTemplates.add(createDefaultTemplate("A0", false));
    return allTemplates;
  }

  public PrintTemplate createTemplate(String pageSize, boolean landscape) {
    PageComponentImpl page = createInstance(PageComponentImpl.class);
    page.setSize(pageSize, landscape);
    page.setTag(PrintTemplate.PAGE);
    MapComponentImpl map = createMap();
    ImageComponentImpl northarrow = createArrow();
    ScaleBarComponentImpl bar = createBar();
    LabelComponentImpl title = createTitle();

    LegendComponentImpl legend = new LegendComponentImpl();
    legend.setTag(PrintTemplate.LEGEND);
    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.component.impl.PageComponentImpl

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.