This PDF document probably uses a compression technique which is not supported by the free parser shipped with FPDI. (See https://www.setasign.com/fpdi-pdf-parser for more details)
FPDIライブラリで、テンプレートファイルを使用する際にエラー発生
解決方法
PDFの読み込みを行うFPDIは、有償のパーサーを別途導入しない場合、PDF 1.5以上のファイルをパースすることができません。テンプレートとなるPDFファイルは PDF 1.4以下の圧縮形式で作成する必要があります。
<?php declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20220105152818 extends AbstractMigration
{
public function up(Schema $schema) : void
{
// this up() migration is auto-generated, please modify it to your needs
}
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
}
}
定数やDBからデータ取得も可能
サンプルコード:dtb_csvへ項目追加
final class Version2022XXXXXXXXXX extends AbstractMigration
{
const ENTITY_NAME = 'Eccube\\\Entity\\Product';
const FIELD_NAME = 'new_column';
public function up(Schema $schema) : void
{
$this->addSql("INSERT INTO dtb_csv (csv_type_id, creator_id, entity_name, field_name, reference_field_name, disp_name, sort_no, enabled, create_date, update_date, discriminator_type) VALUES ('1', null, 'Eccube////////Entity////////Product', 'new_column', 'new_column', '新規項目', '10', '1', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'csv');");
}
public function down(Schema $schema) : void
{
$_ = function($s){return $s;};
$targetId = $this->connection->fetchColumn("SELECT id FROM dtb_csv WHERE entity_name = '{$_(self::ENTITY_NAME)}' AND field_name = '{$_(self::FIELD_NAME)}'");
if (!empty($targetId)) {
$this->addSql("DELETE FROM dtb_csv WHERE id = $targetId;");
}
}
}
framework:
secret: '%env(ECCUBE_AUTH_MAGIC)%'
default_locale: '%locale%'
translator:
fallback: ['%locale%']
csrf_protection: { enabled: true }
http_method_override: true
trusted_hosts: ~
# https://symfony.com/doc/current/reference/configuration/framework.html#handler-id
session:
handler_id: 'Eccube\Session\Storage\Handler\SameSiteNoneCompatSessionHandler'
save_path: '%kernel.project_dir%/var/sessions/%kernel.environment%'
name: '%env(ECCUBE_COOKIE_NAME)%'
cookie_lifetime: '%env(ECCUBE_COOKIE_LIFETIME)%'
gc_maxlifetime: '%env(ECCUBE_GC_MAXLIFETIME)%'
cookie_httponly: true
# When using the HTTP Cache, ESI allows to render page fragments separately
# and with different cache configurations for each fragment
# https://symfony.com/doc/current/book/http_cache.html#edge-side-includes
esi: { enabled: true }
fragments: { enabled: true }
php_errors:
log: true
assets:
base_path: '/html/template/%eccube.theme%'
packages:
admin:
base_path: '/html/template/admin'
save_image:
base_path: '/html/upload/save_image'
plugin:
base_path: '/html/plugin'
install:
base_path: '/html/template/install'
temp_image:
base_path: '/html/upload/temp_image'
user_data:
base_path: '/html/user_data'
# json_manifest_path: '%kernel.project_dir%/public/build/manifest.json'
cache:
# this value is used as part of the "namespace" generated for the cache item keys
# to avoid collisions when multiple apps share the same cache backend (e.g. a Redis server)
# See https://symfony.com/doc/current/reference/configuration/framework.html#prefix-seed
prefix_seed: ec-cube
# The 'ide' option turns all of the file paths in an exception page
# into clickable links that open the given file using your favorite IDE.
# When 'ide' is set to null the file is opened in your web browser.
# See https://symfony.com/doc/current/reference/configuration/framework.html#ide
ide: ~
validation: { enable_annotations: true }
templating: { engines: ['twig'] }
USE eccubedb;
SELECT
P.id page_id
,PL.layout_id
,L.layout_name
,P.page_name
,P.file_name
FROM dtb_page P
LEFT JOIN dtb_page_layout PL ON P.id = PL.page_id
LEFT JOIN dtb_layout L ON PL.layout_id = L.id;