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


Java Document.addSubject方法代碼示例

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


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

示例1: open

import com.lowagie.text.Document; //導入方法依賴的package包/類
public void open(OutputStream out, int mode) throws DocumentException, IOException {
    iOut = out;
    if (mode==sModeText) {
        iPrint = new PrintWriter(iOut);
    } else {
        iNrLines = (mode==sModeLedger?116:50);
        iDoc = new Document(mode==sModeLedger?PageSize.LEDGER.rotate():PageSize.LETTER.rotate());

        PdfWriter.getInstance(iDoc, iOut);

        iDoc.addTitle(iTitle);
        iDoc.addAuthor("UniTime "+Constants.getVersion()+", www.unitime.org");
        iDoc.addSubject(iSubject);
        iDoc.addCreator("UniTime "+Constants.getVersion()+", www.unitime.org");

        iDoc.open();
    }
    iEmpty = true;
    iPageNo = 0; iLineNo = 0;
}
 
開發者ID:Jenner4S,項目名稱:unitimes,代碼行數:21,代碼來源:PdfLegacyReport.java

示例2: addDocumentProps

import com.lowagie.text.Document; //導入方法依賴的package包/類
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,代碼行數:20,代碼來源:EFormPDFServlet.java

示例3: addMetaData

import com.lowagie.text.Document; //導入方法依賴的package包/類
/**
 * Metadata del documento.
 * @param document Documento en cuestión
 */
private void addMetaData(Document document) {
	document.addTitle("My first PDF");
	document.addSubject("Using iText");
	document.addKeywords("Java, PDF, iText");
	document.addAuthor("Lars Vogel");
	document.addCreator("Lars Vogel");
}
 
開發者ID:Arquisoft,項目名稱:citizensLoader4a,代碼行數:12,代碼來源:PDFTextWritter.java

示例4: PdfWorksheet

import com.lowagie.text.Document; //導入方法依賴的package包/類
private PdfWorksheet(OutputStream out, Collection<SubjectArea> subjectAreas, String courseNumber) throws IOException, DocumentException  {
    iUseCommitedAssignments = ApplicationProperty.WorksheetPdfUseCommittedAssignments.isTrue();
    iSubjectAreas = new TreeSet<SubjectArea>(new Comparator<SubjectArea>() {
		@Override
		public int compare(SubjectArea s1, SubjectArea s2) {
			return s1.getSubjectAreaAbbreviation().compareTo(s2.getSubjectAreaAbbreviation());
		}
	});
    iSubjectAreas.addAll(subjectAreas);
    iCourseNumber = courseNumber;
    if (iCourseNumber!=null && (iCourseNumber.trim().length()==0 || "*".equals(iCourseNumber.trim().length())))
        iCourseNumber = null;
    iDoc = new Document(PageSize.LETTER.rotate());

    iOut = out;
    PdfWriter.getInstance(iDoc, iOut);

    String session = null;
    String subjects = "";
    for (SubjectArea sa: iSubjectAreas) {
    	if (subjects.isEmpty()) subjects += ", ";
    	subjects += sa.getSubjectAreaAbbreviation();
    	if (session == null) session += sa.getSession().getLabel();
    }
    iDoc.addTitle(subjects + (iCourseNumber==null?"":" "+iCourseNumber) + " Worksheet");
    iDoc.addAuthor(ApplicationProperty.WorksheetPdfAuthor.value().replace("%", Constants.getVersion()));
    iDoc.addSubject(subjects + (session == null ? "" : " -- " + session));
    iDoc.addCreator("UniTime "+Constants.getVersion()+", www.unitime.org");
    if (!iSubjectAreas.isEmpty())
    	iCurrentSubjectArea = iSubjectAreas.first();

    iDoc.open();
    
    printHeader();
}
 
開發者ID:Jenner4S,項目名稱:unitimes,代碼行數:36,代碼來源:PdfWorksheet.java

示例5: main

import com.lowagie.text.Document; //導入方法依賴的package包/類
/**
 * Generates a PDF file with metadata
 * 
 */
@Test
public void main() throws Exception {

	// step 1: creation of a document-object
	Document document = new Document();
	// step 2:
	// we create a writer that listens to the document
	// and directs a PDF-stream to a file
	HtmlWriter.getInstance(document, PdfTestBase.getOutputStream("HelloWorldMeta.html"));

	// step 3: we add some metadata open the document
	// standard meta information
	document.addTitle("Hello World example");
	document.addAuthor("Bruno Lowagie");
	document.addSubject("This example explains step 3 in Chapter 1");
	document.addKeywords("Metadata, iText, step 3, tutorial");
	// custom (HTML) meta information
	document.addHeader("Expires", "0");
	// meta information that will be in a comment section in HTML
	document.addCreator("My program using iText");
	document.open();
	// step 4: we add a paragraph to the document
	document.add(new Paragraph("Hello World"));

	// step 5: we close the document
	document.close();
}
 
開發者ID:albfernandez,項目名稱:itext2,代碼行數:32,代碼來源:HelloWorldMetaTest.java

示例6: main

import com.lowagie.text.Document; //導入方法依賴的package包/類
/**
 * Generates a PDF file with metadata
 * 
 */
@Test
public void main() throws Exception {

	// step 1: creation of a document-object
	Document document = new Document();
	// step 2:
	// we create a writer that listens to the document
	// and directs a PDF-stream to a file
	PdfWriter.getInstance(document, PdfTestBase.getOutputStream("HelloWorldMeta.pdf"));

	// step 3: we add some metadata open the document
	document.addTitle("Hello World example");
	document.addSubject("This example explains how to add metadata.");
	document.addKeywords("iText, Hello World, step 3, metadata");
	document.addCreator("My program using iText");
	document.addAuthor("Bruno Lowagie");
	document.open();
	// step 4: we add a paragraph to the document
	document.add(new Paragraph("Hello World"));

	// step 5: we close the document
	document.close();
}
 
開發者ID:albfernandez,項目名稱:itext2,代碼行數:28,代碼來源:HelloWorldMetaTest.java


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