Example usage for com.itextpdf.text PageSize B0

List of usage examples for com.itextpdf.text PageSize B0

Introduction

In this page you can find the example usage for com.itextpdf.text PageSize B0.

Prototype

Rectangle B0

To view the source code for com.itextpdf.text PageSize B0.

Click Source Link

Document

This is the b0 format

Usage

From source file:br.com.ifrn.panfleto.gui.PainelCadastrar.java

public Rectangle tamanhoDaPagina() {
    if (comboxSelecionarTamanhoPaginaPainelGerarPdf.getSelectedItem().equals("A0")) {
        return new Rectangle(PageSize.A0);
    } else if (comboxSelecionarTamanhoPaginaPainelGerarPdf.getSelectedItem().equals("A1")) {
        return new Rectangle(PageSize.A1);
    } else if (comboxSelecionarTamanhoPaginaPainelGerarPdf.getSelectedItem().equals("A2")) {
        return new Rectangle(PageSize.A2);
    } else if (comboxSelecionarTamanhoPaginaPainelGerarPdf.getSelectedItem().equals("A3")) {
        return new Rectangle(PageSize.A3);
    } else if (comboxSelecionarTamanhoPaginaPainelGerarPdf.getSelectedItem().equals("A4")) {
        return new Rectangle(PageSize.A4);
    } else if (comboxSelecionarTamanhoPaginaPainelGerarPdf.getSelectedItem().equals("A5")) {
        return new Rectangle(PageSize.A5);
    } else if (comboxSelecionarTamanhoPaginaPainelGerarPdf.getSelectedItem().equals("B0")) {
        return new Rectangle(PageSize.B0);
    } else if (comboxSelecionarTamanhoPaginaPainelGerarPdf.getSelectedItem().equals("B1")) {
        return new Rectangle(PageSize.B1);
    } else if (comboxSelecionarTamanhoPaginaPainelGerarPdf.getSelectedItem().equals("B2")) {
        return new Rectangle(PageSize.B2);
    } else if (comboxSelecionarTamanhoPaginaPainelGerarPdf.getSelectedItem().equals("B3")) {
        return new Rectangle(PageSize.B3);
    } else if (comboxSelecionarTamanhoPaginaPainelGerarPdf.getSelectedItem().equals("B4")) {
        return new Rectangle(PageSize.B4);
    } else if (comboxSelecionarTamanhoPaginaPainelGerarPdf.getSelectedItem().equals("B5")) {
        return new Rectangle(PageSize.B5);
    }/*  w ww. j a v  a 2s .co m*/

    //caso erro, retorna o tamanho a4 como padrao
    return new Rectangle(PageSize.A4);
}

From source file:org.gephi.ui.exporter.preview.UIExporterPDFPanel.java

License:Open Source License

public UIExporterPDFPanel() {
    initComponents();/*from  ww w  .jav a2s .  c  o m*/

    sizeFormatter = NumberFormat.getNumberInstance();
    sizeFormatter.setMaximumFractionDigits(3);
    marginFormatter = NumberFormat.getNumberInstance();
    marginFormatter.setMaximumFractionDigits(1);

    //Page size model - http://en.wikipedia.org/wiki/Paper_size
    DefaultComboBoxModel comboBoxModel = new DefaultComboBoxModel();
    comboBoxModel.addElement(new PageSizeItem(PageSize.A0, "A0", 841, 1189, 33.1, 46.8));
    comboBoxModel.addElement(new PageSizeItem(PageSize.A1, "A1", 594, 841, 23.4, 33.1));
    comboBoxModel.addElement(new PageSizeItem(PageSize.A2, "A2", 420, 594, 16.5, 23.4));
    comboBoxModel.addElement(new PageSizeItem(PageSize.A3, "A3", 297, 420, 11.7, 16.5));
    comboBoxModel.addElement(new PageSizeItem(PageSize.A4, "A4", 210, 297, 8.3, 11.7));
    comboBoxModel.addElement(new PageSizeItem(PageSize.A5, "A5", 148, 210, 5.8, 8.3));
    comboBoxModel.addElement(new PageSizeItem(PageSize.ARCH_A, "ARCH A", 229, 305, 9, 12));
    comboBoxModel.addElement(new PageSizeItem(PageSize.ARCH_B, "ARCH B", 305, 457, 12, 18));
    comboBoxModel.addElement(new PageSizeItem(PageSize.ARCH_C, "ARCH C", 457, 610, 18, 24));
    comboBoxModel.addElement(new PageSizeItem(PageSize.ARCH_D, "ARCH D", 610, 914, 24, 36));
    comboBoxModel.addElement(new PageSizeItem(PageSize.ARCH_E, "ARCH E", 914, 1219, 36, 48));
    comboBoxModel.addElement(new PageSizeItem(PageSize.B0, "B0", 1000, 1414, 39.4, 55.7));
    comboBoxModel.addElement(new PageSizeItem(PageSize.B1, "B1", 707, 1000, 27.8, 39.4));
    comboBoxModel.addElement(new PageSizeItem(PageSize.B2, "B2", 500, 707, 19.7, 27.8));
    comboBoxModel.addElement(new PageSizeItem(PageSize.B3, "B3", 353, 500, 13.9, 19.7));
    comboBoxModel.addElement(new PageSizeItem(PageSize.B4, "B4", 250, 353, 9.8, 13.9));
    comboBoxModel.addElement(new PageSizeItem(PageSize.B5, "B5", 176, 250, 6.9, 9.8));
    comboBoxModel.addElement(new PageSizeItem(PageSize.LEDGER, "Ledger", 432, 279, 17, 11));
    comboBoxModel.addElement(new PageSizeItem(PageSize.LEGAL, "Legal", 216, 356, 8.5, 14));
    comboBoxModel.addElement(new PageSizeItem(PageSize.LETTER, "Letter", 216, 279, 8.5, 11));
    comboBoxModel.addElement(new PageSizeItem(PageSize.TABLOID, "Tabloid", 279, 432, 11, 17));

    customSizeString = NbBundle.getMessage(UIExporterPDFPanel.class, "UIExporterPDFPanel.pageSize.custom");
    comboBoxModel.addElement(customSizeString);
    pageSizeCombo.setModel(comboBoxModel);

    loadPreferences();

    initEvents();
    refreshUnit(false);
}