當前位置: 首頁>>代碼示例>>Java>>正文


Java PageSize.LETTER屬性代碼示例

本文整理匯總了Java中com.lowagie.text.PageSize.LETTER屬性的典型用法代碼示例。如果您正苦於以下問題:Java PageSize.LETTER屬性的具體用法?Java PageSize.LETTER怎麽用?Java PageSize.LETTER使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在com.lowagie.text.PageSize的用法示例。


在下文中一共展示了PageSize.LETTER屬性的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: addDocumentProps

private void addDocumentProps(Document document, String title, Properties props) {
    document.addTitle(title);
    document.addSubject("");
    document.addKeywords("pdf, itext");
    document.addCreator("OSCAR");
    document.addAuthor("");
    
    // A0-A10, LEGAL, LETTER, HALFLETTER, _11x17, LEDGER, NOTE, B0-B5, ARCH_A-ARCH_E, FLSA
    // and FLSE
    // the following shows a temp way to get a print page size
    final String PAGESIZE = "printPageSize";
    Rectangle pageSize = PageSize.LETTER;
    if ("PageSize.HALFLETTER".equals(props.getProperty(PAGESIZE)))
        pageSize = PageSize.HALFLETTER;
    if ("PageSize.A6".equals(props.getProperty(PAGESIZE)))
        pageSize = PageSize.A6;
    document.setPageSize(pageSize);
    document.open();
}
 
開發者ID:williamgrosset,項目名稱:OSCAR-ConCert,代碼行數:19,代碼來源:EFormPDFServlet.java

示例2: getPdfDoc

protected com.lowagie.text.Document getPdfDoc() throws IOException, DocumentException {

        String reportDropFolder = reportsDirectory + "/" + ArConstants.Lockbox.LOCKBOX_REPORT_SUBFOLDER + "/";
        String fileName = ArConstants.Lockbox.BATCH_REPORT_BASENAME + "_" +
        new SimpleDateFormat("yyyyMMdd_HHmmssSSS").format(dateTimeService.getCurrentDate()) + ".pdf";

        //  setup the writer
        File reportFile = new File(reportDropFolder + fileName);
        FileOutputStream fileOutStream;
        fileOutStream = new FileOutputStream(reportFile);
        BufferedOutputStream buffOutStream = new BufferedOutputStream(fileOutStream);

        com.lowagie.text.Document pdfdoc = new com.lowagie.text.Document(PageSize.LETTER, 54, 54, 72, 72);
        PdfWriter.getInstance(pdfdoc, buffOutStream);

        pdfdoc.open();

        return pdfdoc;
    }
 
開發者ID:kuali,項目名稱:kfs,代碼行數:19,代碼來源:LockboxServiceImpl.java

示例3: getPdfDoc

protected com.lowagie.text.Document getPdfDoc() throws IOException, DocumentException {

        String reportDropFolder = reportsDirectory + "/" + ArConstants.CustomerInvoiceWriteoff.CUSTOMER_INVOICE_WRITEOFF_REPORT_SUBFOLDER + "/";
        String fileName = ArConstants.CustomerInvoiceWriteoff.BATCH_REPORT_BASENAME + "_" +
            new SimpleDateFormat("yyyyMMdd_HHmmssSSS").format(dateTimeService.getCurrentDate()) + ".pdf";

        //  setup the writer
        File reportFile = new File(reportDropFolder + fileName);
        FileOutputStream fileOutStream;
        fileOutStream = new FileOutputStream(reportFile);
        BufferedOutputStream buffOutStream = new BufferedOutputStream(fileOutStream);

        com.lowagie.text.Document pdfdoc = new com.lowagie.text.Document(PageSize.LETTER, 54, 54, 72, 72);
        PdfWriter.getInstance(pdfdoc, buffOutStream);

        pdfdoc.open();

        return pdfdoc;
    }
 
開發者ID:kuali,項目名稱:kfs,代碼行數:19,代碼來源:CustomerInvoiceWriteoffBatchServiceImpl.java

示例4: addDocumentProps

private void addDocumentProps(Document document, String title, Properties props) {
    document.addTitle(title);
    document.addSubject("");
    document.addKeywords("pdf, itext");
    document.addCreator("OSCAR");
    document.addAuthor("");
    document.addHeader("Expires", "0");

    // A0-A10, LEGAL, LETTER, HALFLETTER, _11x17, LEDGER, NOTE, B0-B5, ARCH_A-ARCH_E, FLSA
    // and FLSE
    // the following shows a temp way to get a print page size
    final String PAGESIZE = "printPageSize";
    Rectangle pageSize = PageSize.LETTER;
    if ("PageSize.HALFLETTER".equals(props.getProperty(PAGESIZE)))
        pageSize = PageSize.HALFLETTER;
    if ("PageSize.A6".equals(props.getProperty(PAGESIZE)))
        pageSize = PageSize.A6;
    document.setPageSize(pageSize);
    document.open();
}
 
開發者ID:oscarservice,項目名稱:oscar-old,代碼行數:20,代碼來源:EFormPDFServlet.java

示例5: getPageSize

private Rectangle getPageSize(boolean landscape) {
	Rectangle pageSize;
	if (Locale.US.getCountry().equals(I18N.getCurrentLocale().getCountry())) {
		// Letter size paper is used in the US instead of the ISO standard A4
		pageSize = PageSize.LETTER;
	} else {
		pageSize = PageSize.A4;
	}
	if (landscape) {
		pageSize = pageSize.rotate();
	}
	return pageSize;
}
 
開發者ID:javamelody,項目名稱:javamelody,代碼行數:13,代碼來源:PdfDocumentFactory.java

示例6: printCards

private void printCards(
		List<String> triples,
		String blanks,
		String category,
		String fileName, 
		Random random)
		throws FileNotFoundException, DocumentException
{
	Document document = new Document(PageSize.LETTER);
	Font font = new Font(Font.COURIER, 200);
	PdfWriter writer = 
		PdfWriter.getInstance(document, new FileOutputStream(fileName));
	writer.setPageEvent(new PageHandler(fileName));
	try
	{
		document.open();
		Paragraph categoryParagraph = new Paragraph(
				"From the " + category + " category",
				new Font(Font.TIMES_ROMAN, 36));
		categoryParagraph.setAlignment(Paragraph.ALIGN_CENTER);
		document.add(categoryParagraph);
		
		document.add(new Paragraph(blanks, new Font(Font.COURIER, 50)));
		document.newPage();

		for (String triple : triples)
		{
			Paragraph p = new Paragraph(triple, font);
			p.setAlignment(Paragraph.ALIGN_CENTER);
			document.add(p);
			document.newPage();
		}
	}
	finally
	{
		document.close();
	}
}
 
開發者ID:donkirkby,項目名稱:donkirkby,代碼行數:38,代碼來源:App.java

示例7: writeReportPDF

protected void writeReportPDF(List<CustomerLoadFileResult> fileResults) {

        if (fileResults.isEmpty()) {
            return;
        }

        //  setup the PDF business
        Document pdfDoc = new Document(PageSize.LETTER, 54, 54, 72, 72);
        try {
            getPdfWriter(pdfDoc);
            try {
                pdfDoc.open();

                if (fileResults.isEmpty()) {
                    writeFileNameSectionTitle(pdfDoc, "NO DOCUMENTS FOUND TO PROCESS");
                    return;
                }

                CustomerLoadResult result;
                String customerResultLine;
                for (CustomerLoadFileResult fileResult : fileResults) {

                    //  file name title
                    String fileNameOnly = fileResult.getFilename().toUpperCase();
                    fileNameOnly = fileNameOnly.substring(fileNameOnly.lastIndexOf("\\") + 1);
                    writeFileNameSectionTitle(pdfDoc, fileNameOnly);

                    //  write any file-general messages
                    writeMessageEntryLines(pdfDoc, fileResult.getMessages());

                    //  walk through each customer included in this file
                    for (String customerName : fileResult.getCustomerNames()) {
                        result = fileResult.getCustomer(customerName);

                        //  write the customer title
                        writeCustomerSectionTitle(pdfDoc, customerName.toUpperCase());

                        //  write a success/failure results line for this customer
                        customerResultLine = result.getResultString() + (ResultCode.SUCCESS.equals(result.getResult()) ? WORKFLOW_DOC_ID_PREFIX + result.getWorkflowDocId() : "");
                        writeCustomerSectionResult(pdfDoc, customerResultLine);

                        //  write any customer messages
                        writeMessageEntryLines(pdfDoc, result.getMessages());
                    }
                }
            } finally {
                if (pdfDoc != null) {
                    pdfDoc.close();
                }
            }
        }
        catch (IOException | DocumentException ex) {
            throw new RuntimeException("Could not open file for results report",ex);
        }
    }
 
開發者ID:kuali,項目名稱:kfs,代碼行數:55,代碼來源:CustomerLoadServiceImpl.java


注:本文中的com.lowagie.text.PageSize.LETTER屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。