本文整理汇总了Java中com.lowagie.text.Document.addKeywords方法的典型用法代码示例。如果您正苦于以下问题:Java Document.addKeywords方法的具体用法?Java Document.addKeywords怎么用?Java Document.addKeywords使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.lowagie.text.Document
的用法示例。
在下文中一共展示了Document.addKeywords方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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();
}
示例2: 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");
}
示例3: 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();
}
示例4: 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();
}