- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中com.adobe.xmp.XMPException
类的一些代码示例,展示了XMPException
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XMPException
类的具体详情如下:
包路径:com.adobe.xmp.XMPException
类名称:XMPException
[英]This exception wraps all errors that occur in the XMP Toolkit.
[中]此异常封装了XMP工具包中发生的所有错误。
代码示例来源:origin: drewnoakes/metadata-extractor
/**
* Performs the XMP data extraction, adding found values to the specified instance of {@link Metadata}.
* <p>
* The extraction is done with Adobe's XMPCore library.
*/
public void extract(@NotNull final String xmpString, @NotNull Metadata metadata, @Nullable Directory parentDirectory)
{
XmpDirectory directory = new XmpDirectory();
if (parentDirectory != null)
directory.setParent(parentDirectory);
try {
XMPMeta xmpMeta = XMPMetaFactory.parseFromString(xmpString);
directory.setXMPMeta(xmpMeta);
} catch (XMPException e) {
directory.addError("Error processing XMP data: " + e.getMessage());
}
if (!directory.isEmpty())
metadata.addDirectory(directory);
}
代码示例来源:origin: veraPDF/veraPDF-library
/**
* 7.2.20 parseTypeOtherPropertyElt
* start-element ( URI == propertyElementURIs, attributes == set ( idAttr?, parseOther ) )
* propertyEltList
* end-element()
*
* @throws XMPException thown on parsing errors
*/
private static void rdf_ParseTypeOtherPropertyElement() throws XMPException
{
throw new XMPException("ParseTypeOther property element not allowed", BADXMP);
}
代码示例来源:origin: drewnoakes/metadata-extractor
/**
* Serializes the XmpDirectory component of <code>Metadata</code> into an <code>OutputStream</code>
* @param os Destination for the xmp data
* @param data populated metadata
* @return serialize success
*/
public static boolean write(OutputStream os, Metadata data)
{
XmpDirectory dir = data.getFirstDirectoryOfType(XmpDirectory.class);
if (dir == null)
return false;
XMPMeta meta = dir.getXMPMeta();
try
{
SerializeOptions so = new SerializeOptions().setOmitPacketWrapper(true);
XMPMetaFactory.serialize(meta, os, so);
}
catch (XMPException e)
{
e.printStackTrace();
return false;
}
return true;
}
}
代码示例来源:origin: veraPDF/veraPDF-library
if (e.getErrorCode() == XMPError.BADXML ||
e.getErrorCode() == XMPError.BADSTREAM)
throw new XMPException("Unsupported Encoding",
XMPError.INTERNALFAILURE, e);
代码示例来源:origin: veraPDF/veraPDF-library
/**
* Parses XML from a {@link String},
* fixing the illegal control character optionally.
*
* @param input a <code>String</code> containing the XMP packet
* @param options the parsing options
* @return Returns an XML DOM-Document.
* @throws XMPException Thrown when the parsing fails.
*/
private static Document parseXmlFromString(String input, ParseOptions options)
throws XMPException
{
InputSource source = new InputSource(new StringReader(input));
try
{
return parseInputSource(source);
}
catch (XMPException e)
{
if (e.getErrorCode() == XMPError.BADXML && options.getFixControlChars())
{
source = new InputSource(new FixASCIIControlsReader(new StringReader(input)));
return parseInputSource(source);
}
else
{
throw e;
}
}
}
代码示例来源:origin: drewnoakes/metadata-extractor
/**
* Performs the XMP data extraction, adding found values to the specified instance of {@link Metadata}.
* <p>
* The extraction is done with Adobe's XMPCore library.
*/
public void extract(@NotNull final byte[] xmpBytes, int offset, int length, @NotNull Metadata metadata, @Nullable Directory parentDirectory)
{
XmpDirectory directory = new XmpDirectory();
if (parentDirectory != null)
directory.setParent(parentDirectory);
try {
XMPMeta xmpMeta;
// If all xmpBytes are requested, no need to make a new ByteBuffer
if (offset == 0 && length == xmpBytes.length) {
xmpMeta = XMPMetaFactory.parseFromBuffer(xmpBytes);
} else {
ByteBuffer buffer = new ByteBuffer(xmpBytes, offset, length);
xmpMeta = XMPMetaFactory.parse(buffer.getByteStream());
}
directory.setXMPMeta(xmpMeta);
} catch (XMPException e) {
directory.addError("Error processing XMP data: " + e.getMessage());
}
if (!directory.isEmpty())
metadata.addDirectory(directory);
}
代码示例来源:origin: veraPDF/veraPDF-library
/**
* 7.2.17 parseTypeLiteralPropertyElt
* start-element ( URI == propertyElementURIs,
* attributes == set ( idAttr?, parseLiteral ) )
* literal
* end-element()
*
* @throws XMPException thown on parsing errors
*/
private static void rdf_ParseTypeLiteralPropertyElement() throws XMPException
{
throw new XMPException("ParseTypeLiteral property element not allowed", BADXMP);
}
代码示例来源:origin: drewnoakes/metadata-extractor
e.printStackTrace();
代码示例来源:origin: org.verapdf/pdfbox-metadata-fixer
private static MetadataImpl parseMetadata(PDMetadata meta) {
try {
VeraPDFMeta xmp = VeraPDFMeta.parse(meta.getStream().getUnfilteredStream());
if (xmp != null) {
return new MetadataImpl(xmp, meta.getStream());
}
} catch (IOException e) {
LOGGER.debug("Problems with document parsing or structure. " + e.getMessage(), e);
} catch (XMPException e) {
LOGGER.debug("Problems with XMP parsing. " + e.getMessage(), e);
}
return null;
}
代码示例来源:origin: veraPDF/veraPDF-library
/**
* 7.2.19 parseTypeCollectionPropertyElt
* start-element ( URI == propertyElementURIs,
* attributes == set ( idAttr?, parseCollection ) )
* nodeElementList
* end-element()
*
* @throws XMPException thown on parsing errors
*/
private static void rdf_ParseTypeCollectionPropertyElement() throws XMPException
{
throw new XMPException("ParseTypeCollection property element not allowed", BADXMP);
}
代码示例来源:origin: com.drewnoakes/metadata-extractor
/**
* Serializes the XmpDirectory component of <code>Metadata</code> into an <code>OutputStream</code>
* @param os Destination for the xmp data
* @param data populated metadata
* @return serialize success
*/
public static boolean write(OutputStream os, Metadata data)
{
XmpDirectory dir = data.getFirstDirectoryOfType(XmpDirectory.class);
if (dir == null)
return false;
XMPMeta meta = dir.getXMPMeta();
try
{
SerializeOptions so = new SerializeOptions().setOmitPacketWrapper(true);
XMPMetaFactory.serialize(meta, os, so);
}
catch (XMPException e)
{
e.printStackTrace();
return false;
}
return true;
}
}
代码示例来源:origin: org.verapdf/metadata-fixer
private static MetadataImpl parseMetadata(PDMetadata meta, PDDocument document) {
try {
VeraPDFMeta xmp = VeraPDFMeta.parse(meta.getStream());
if (xmp != null) {
return new MetadataImpl(xmp, meta.getObject(),
document.getDocument(), false);
}
} catch (XMPException e) {
LOGGER.log(Level.FINE, "Problems with XMP parsing. " + e.getMessage(), e);
}
return null;
}
代码示例来源:origin: veraPDF/veraPDF-library
/**
* Asserts that the xmp object is of this implemention
* ({@link XMPMetaImpl}).
* @param xmp the XMP object
* @throws XMPException A wrong implentaion is used.
*/
public static void assertImplementation(XMPMeta xmp) throws XMPException
{
if (xmp == null)
{
throw new XMPException("Parameter must not be null",
XMPError.BADPARAM);
}
else if (!(xmp instanceof XMPMetaImpl))
{
throw new XMPException("The XMPMeta-object is not compatible with this implementation",
XMPError.BADPARAM);
}
}
}
代码示例来源:origin: com.drewnoakes/metadata-extractor
e.printStackTrace();
代码示例来源:origin: org.verapdf/validation-model
/**
* Matches properties of document information dictionary and xmp metadata.
*
* @param document which will be tested
* @return true if fields of xmp matches with fields of info dictionary
*/
public static Boolean doesInfoMatchXMP(COSDocument document) {
COSObject info = getInformationDictionary(document);
if (info == null) {
return Boolean.TRUE;
}
try (InputStream metadataStream = getMetadataStream(document)) {
if (metadataStream != null) {
VeraPDFMeta metadata = VeraPDFMeta.parse(metadataStream);
Map<ASAtom, Object> properties = new HashMap<>(
MAX_REQUIRED_RECORDS);
getTitleAuthorSubject(metadata, properties);
getProducerKeywords(metadata, properties);
getCreatorAndDates(metadata, properties);
return checkMatch(info, properties);
}
} catch (IOException e) {
LOGGER.log(Level.FINE,
"Problems with document parsing or structure. "
+ e.getMessage(), e);
} catch (XMPException e) {
LOGGER.log(Level.FINE, "Problems with XMP parsing. " + e.getMessage(), e);
}
return Boolean.FALSE;
}
代码示例来源:origin: veraPDF/veraPDF-library
/**
* Checks that a node not a struct and array at the same time;
* and URI cannot be a struct.
*
* @param options the bitmask to check.
* @throws XMPException Thrown if the options are not consistent.
*/
public void assertConsistency(int options) throws XMPException
{
if ((options & STRUCT) > 0 && (options & ARRAY) > 0)
{
throw new XMPException("IsStruct and IsArray options are mutually exclusive",
XMPError.BADOPTIONS);
}
else if ((options & URI) > 0 && (options & (ARRAY | STRUCT)) > 0)
{
throw new XMPException("Structs and arrays can't have \"value\" options",
XMPError.BADOPTIONS);
}
}
}
代码示例来源:origin: org.verapdf/pdfbox-validation-model
/**
* Matches properties of document information dictionary and xmp metadata.
*
* @param document
* which will be tested
* @return true if fields of xmp matches with fields of info dictionary
*/
public static Boolean doesInfoMatchXMP(COSDocument document) {
COSDictionary info = getInformationDictionary(document);
if (info == null) {
return Boolean.TRUE;
}
try {
COSStream meta = getMetadataDictionary(document);
if (meta != null) {
VeraPDFMeta metadata = VeraPDFMeta.parse(meta.getUnfilteredStream());
Map<String, Object> properties = new HashMap<>(MAX_REQUIRED_RECORDS);
getTitleAuthorSubject(metadata, properties);
getProducerKeywords(metadata, properties);
getCreatorAndDates(metadata, properties);
return checkMatch(info, properties);
}
} catch (IOException e) {
LOGGER.debug("Problems with document parsing or structure. " + e.getMessage(), e);
} catch (XMPException e) {
LOGGER.debug("Problems with XMP parsing. " + e.getMessage(), e);
}
return Boolean.FALSE;
}
代码示例来源:origin: veraPDF/veraPDF-library
/**
* Asserts that any string parameter is set.
* @param param any string parameter
* @throws XMPException Thrown if the parameter is null or has length 0.
*/
public static void assertNotNull(Object param) throws XMPException
{
if (param == null)
{
throw new XMPException("Parameter must not be null", XMPError.BADPARAM);
}
else if ((param instanceof String) && ((String) param).length() == 0)
{
throw new XMPException("Parameter must not be null or empty", XMPError.BADPARAM);
}
}
代码示例来源:origin: org.verapdf/validation-model
logger.log(Level.FINE, e.getMessage(), e);
return defaultFlavour;
} catch (IOException e) {
代码示例来源:origin: veraPDF/veraPDF-library
/**
* ParameterAsserts that a qualifier namespace is set.
* @param qualNS a qualifier namespace
* @throws XMPException Qualifier schema is null or empty
*/
private static void assertQualNS(String qualNS) throws XMPException
{
if (qualNS == null || qualNS.length() == 0)
{
throw new XMPException("Empty qualifier namespace URI", XMPError.BADSCHEMA);
}
}
来历及作用 进程程序文件是由深圳市迅雷网络技术有限公司为其发布迅雷看看播放器定义的一个多媒体在线播放程序。如果用户在Windows任务管理器中看到xmp.exe程序在运行,这说明您的电脑里安装了此
很多朋友在用迅雷看看观看电影视频的时候,都会出现下面这种情况,弹出一个虫子,然后抱歉的跟你说:xmp.exe崩溃了。那么xmp.exe崩溃如何解决?不用担心,今天小编将带领大家一起解决这一问题!
我发现了 XMP 标签,它对于逐字复制所有内容非常有用,直到结束 xmp 标签。 'aaa' 生成的CSS: pre, xmp, plaintext, listing { display: blo
有人记得 XMP 标签吗? 它的用途是什么?为什么不推荐使用它? 最佳答案 XMP和 PRE不同。 PRE内的内容标签格式如下: 内容以固定字体显示, 保留所有空格,并且 每个换行符开始一个新行。 如
本文整理了Java中com.adobe.xmp.XMPMeta类的一些代码示例,展示了XMPMeta类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从
本文整理了Java中com.adobe.xmp.XMPException类的一些代码示例,展示了XMPException类的具体用法。这些代码示例主要来源于Github/Stackoverflow/M
我从 N 个图像创建一个 PDF。使用此命令行即可简单直接: convert front1.png back1.png front2.png back2.png result.pdf 不幸的是,一些信
我像这样拆分和合并一些 pdf 文件 pdftk A=content.pdf B=frontside.pdf cat B1 A5-2 output output.pdf 2>&1 结果很好,但不再有
从 tif 文件中提取元数据时,我遇到了上述问题。它的大小超过 450 MB。我正在使用 http://commons.apache.org/sanselan/ 提取最新版本(0.97)中的库。当我执
如何在不使用 XMP 元素的情况下在 HTML5 网站上显示包含标签的 HTML 标记? 本站采用HTML5制作,并展示HTML、C++等教程 所以我需要展示很多编程语言的源代码。 最佳答案 最常用的
我最近了解到xmp标签的使用,它已被弃用,很多人说使用pre,或者用 等 ...但这些解决方案对我来说并不好。 实际上,我想将内容放入网页中,并且在我使用 JavaScript 将其复制到其他容器中之
我需要在页面上显示一些代码而不对其进行解析 - 我可以使用 XMP 来执行此操作,但它似乎不在其所在容器的范围内?有没有办法让它适应 div 的宽度? http://codepen.io/r3dg3c
hi how are you? 应该渲染 hi how are you? 不 hi How are you? 句子的选择并不重要。我需要这个用于我正在制作的 HTML 标签表以帮助我进行编码,我需要
如果我要在 Python 中通过 XMP 标记一堆图像,最好的方法是什么?我使用过 Perl 的 Image::ExifTool 并且我非常习惯它的可靠性。我的意思是,这东西从未在数万张图片上变砖。
官方已弃用(但仍受主要浏览器支持),因此为了使新应用程序合法,唯一的解决方法是替换 xmp标签(不解析 HTML 的标签)是按我发现的那样使用:... . 此解决方案一切正常,但 Firefox(仅)
本文整理了Java中org.apache.jempbox.xmp.XMPMetadata类的一些代码示例,展示了XMPMetadata类的具体用法。这些代码示例主要来源于Github/Stackove
在过去的几个小时里,我一直试图了解 XMP 元数据如何处理 PNG 文件,但无法完全理解它。 如果我用 Photoshop 创建一个 PNG 图像,保存它并打开文件信息对话框(文件 > 文件信息或 C
我很好奇是否可以为 XMP Dublin Core metadata 创建自定义命名空间? 例如,如果我想添加像 mytest 这样的标签 我可以编写 XMP 元数据标准标签,例如 descripti
我需要将 XMP 元数据添加到 PDF 文件中,而我进行的谷歌搜索并没有太大帮助。我正在寻找类似于 PDFTK 的工具,我可以通过命令行或脚本运行它以将 XMP 元数据添加到 PDF 中。 如果有办法
我正在尝试为发票创建 PDF/A 文件。因此,我尝试使用 gofpdf 为我的文件设置 XMP header 。图书馆。设置 header 似乎工作正常,但我的任何验证器(如 exiftool 或验证
我是一名优秀的程序员,十分优秀!