当前位置: 首页>>代码示例>>Java>>正文


Java XMPSchemaBasic类代码示例

本文整理汇总了Java中org.apache.jempbox.xmp.XMPSchemaBasic的典型用法代码示例。如果您正苦于以下问题:Java XMPSchemaBasic类的具体用法?Java XMPSchemaBasic怎么用?Java XMPSchemaBasic使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


XMPSchemaBasic类属于org.apache.jempbox.xmp包,在下文中一共展示了XMPSchemaBasic类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setMetadata

import org.apache.jempbox.xmp.XMPSchemaBasic; //导入依赖的package包/类
public void setMetadata(PDDocument doc) throws Exception {
	PDDocumentCatalog catalog = doc.getDocumentCatalog();
	PDDocumentInformation info = doc.getDocumentInformation();
	GregorianCalendar cal = new GregorianCalendar();
	cal.setTime(now);
	XMPMetadata metadata = new XMPMetadata();
	XMPSchemaPDF pdfSchema = metadata.addPDFSchema();
	pdfSchema.setKeywords(info.getKeywords());
	pdfSchema.setProducer(info.getProducer());
	XMPSchemaBasic basicSchema = metadata.addBasicSchema();
	basicSchema.setModifyDate(cal);
	basicSchema.setCreateDate(cal);
	basicSchema.setCreatorTool(info.getCreator());
	basicSchema.setMetadataDate(cal);
	XMPSchemaDublinCore dcSchema = metadata.addDublinCoreSchema();
	dcSchema.setTitle(info.getTitle());
	dcSchema.addCreator("PDFBox");
	dcSchema.setDescription(info.getSubject());
	PDMetadata metadataStream = new PDMetadata(doc);
	metadataStream.importXMPMetadata(metadata);
	catalog.setMetadata(metadataStream);
}
 
开发者ID:phoenixctms,项目名称:ctsms,代码行数:23,代码来源:PDFPainterBase.java

示例2: writePDFA

import org.apache.jempbox.xmp.XMPSchemaBasic; //导入依赖的package包/类
private File writePDFA(File pdfWithAttachments, FlowInstanceManager instanceManager, FlowInstanceEvent event) throws Exception {

		File outputFile = getFile(instanceManager.getFlowInstanceID(), event);

		outputFile.getParentFile().mkdirs();

		PDDocument document = PDDocument.loadNonSeq(pdfWithAttachments, null);

		try{
			document.getDocumentInformation().setProducer("Open ePlatform 1.x");

			PDDocumentCatalog cat = document.getDocumentCatalog();
			PDMetadata metadata = new PDMetadata(document);
			cat.setMetadata(metadata);

			XMPMetadata xmp = new XMPMetadata();
			XMPSchemaPDFAId pdfaid = new XMPSchemaPDFAId(xmp);
			xmp.addSchema(pdfaid);
			pdfaid.setConformance("A");
			pdfaid.setPart(3);
			pdfaid.setAbout("");

			XMPSchemaBasic schemaBasic = new XMPSchemaBasic(xmp);

			schemaBasic.setCreateDate(document.getDocumentInformation().getCreationDate());
			schemaBasic.setModifyDate(document.getDocumentInformation().getModificationDate());
			xmp.addSchema(schemaBasic);

			XMPSchemaPDF schemaPDF = new XMPSchemaPDF(xmp);
			schemaPDF.setProducer(document.getDocumentInformation().getProducer());
			xmp.addSchema(schemaPDF);

			XMPSchemaDublinCore schemaDublinCore = new XMPSchemaDublinCore(xmp);
			schemaDublinCore.setTitle(document.getDocumentInformation().getTitle());
			xmp.addSchema(schemaDublinCore);

			metadata.importXMPMetadata(xmp);

			InputStream colorProfile = this.getClass().getResourceAsStream("sRGB Color Space Profile.icm");

			PDOutputIntent oi = new PDOutputIntent(document, colorProfile);
			oi.setInfo("sRGB IEC61966-2.1");
			oi.setOutputCondition("sRGB IEC61966-2.1");
			oi.setOutputConditionIdentifier("sRGB IEC61966-2.1");
			oi.setRegistryName("http://www.color.org");
			cat.addOutputIntent(oi);

			document.save(outputFile);

		}finally{

			document.close();
		}

		return outputFile;
	}
 
开发者ID:Sundsvallskommun,项目名称:Open-ePlatform,代码行数:57,代码来源:PDFGeneratorModule.java


注:本文中的org.apache.jempbox.xmp.XMPSchemaBasic类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。