定制 bitandblack/idml-validator 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

bitandblack/idml-validator

最新稳定版本:1.1.0

Composer 安装命令:

composer require bitandblack/idml-validator

包简介

Validates IDML files by the official schema from Adobe.

README 文档

README

PHP from Packagist Codacy Badge Total Downloads License

IDML Validator

Validates IDML files by the official schema from Adobe.

Installation

This library is made for the use with Composer. Add it to your project by running $ composer require bitandblack/idml-validator.

Usage

The IDML Validator is mainly meant to be used by CLI. Nevertheless it can also be integrated in a PHP project.

Execute a validation via CLI

Run $ php vendor/bin/idml-validator validate /path/to/file.idml to validate your IDML file.

This will print something like:

Found 3 errors:
┌──────┬───────────────────────── designmap.xml ────────────────────────────────┐
│ Line │ Message                                                                │
├──────┼────────────────────────────────────────────────────────────────────────┤
│ 3    │ Element 'Document', attribute 'DOMVersion': [facet 'enumeration'] The  │
│      │ value '14.0' is not an element of the set {'8.0'}.                     │
├──────┼────────────────────────────────────────────────────────────────────────┤
│ 3    │ Element 'Document', attribute 'DOMVersion': '14.0' is not a valid valu │
│      │ e of the local atomic type.                                            │
├──────┼────────────────────────────────────────────────────────────────────────┤
│ 23   │ Element 'EndnoteOption': This element is not expected. Expected is one │
│      │ of ( TextVariable, {http://ns.adobe.com/AdobeInDesign/idml/1.0/packagi │
│      │ ng}Tags, Layer, {http://ns.adobe.com/AdobeInDesign/idml/1.0/packaging} │
│      │ MasterSpread, {http://ns.adobe.com/AdobeInDesign/idml/1.0/packaging}Sp │
│      │ read, Section, DocumentUser, CrossReferenceFormat, Index, {http://ns.a │
│      │ dobe.com/AdobeInDesign/idml/1.0/packaging}BackingStory ).              │
└──────┴────────────────────────────────────────────────────────────────────────┘

Custom

For an integrated use of the validator, take the Validation class, give it a file and a schema:

<?php

use IDML\Validator\File;
use IDML\Validator\Schema;
use IDML\Validator\Validation;

$validation = new Validation(
    new File('/path/to/file.idml'),
    new Schema()
);

$validation->validate();
$errors = $validation->getErrors();

One problem

A huge problem is that Adobe hasn't updated the schema since InDesign CS6. So every newer function will end in an error, even when it's official possible. We're talking to Adobe and waiting for an answer at the moment. So be careful about the errors and don't mind when you believe a function is possible but throws an error.

Help

If you have any questions feel free to contact us under hello@bitandblack.com.

Further information about Bit&Black can be found under www.bitandblack.com.

统计信息

  • 总下载量: 255
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 2

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-12-06

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固