2017 © Pedro Peláez
 

library php-docxtable

A simple utility to update the table style contained in the docx file.

image

kojiro526/php-docxtable

A simple utility to update the table style contained in the docx file.

  • Sunday, October 22, 2017
  • by kojiro526
  • Repository
  • 1 Watchers
  • 0 Stars
  • 44 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 38 % Grown

The README.md

テーブルスタイル置換ツール

docxファイル内のテーブルのスタイルを、ファイル内の特定のテーブルスタイルに一括で置換するツールです。, (*1)

必要要件

PHP 5.6 以上, (*2)

事前の設定

このコマンドはcomposerでグローバルインストールして使うことを想定しているため、以下のディレクトリにパスを通して下さい。, (*3)

Linux, OSX等

.bash_profile等に以下のパスを設定して下さい。, (*4)

export PATH=$HOME/.composer/vendor/bin:$PATH

Windows

Windowsでは以下のフォルダを環境変数のPATHに設定して下さい。, (*5)

%USERPROFILE%\AppData\Roaming\Composer\vendor\bin

インストール

$ composer global require kojiro526/php-docxtable

使い方

docxファイル内のテーブルスタイルには内部的にIDが割り当てられており、本文内のテーブルのスタイルIDを上書きすれば、テーブルのスタイルを変更できます。, (*6)

スタイルIDの確認

まず、以下のコマンドでdocxファイル内のテーブルスタイルのIDを取得します。, (*7)

$ docxtable-php styles -f ./example.docx
1:
 styleId: a2
 name: Normal Table
2:
 styleId: af5
 name: Table Grid
3:
 styleId: MyTable
 name: MyTable
 ```

上記の「MyTable」という名前のスタイルに変更したい場合、そのstyleId("MyTable")を控えます。

### スタイルIDの変更

次に、以下のコマンドでdocxファイル内の全てのテーブルのスタイルを"MyTable"というIDで上書きします。

$ docxtable-php update -f ./example.docx -s MyTable -o ./output.docx, (*8)


出力先の指定を省略すると、元のファイルを上書きします。

$ docxtable-php update -f ./example.docx -s MyTable ```, (*9)

以上で、テーブルのスタイル変更は完了です。, (*10)

The Versions

22/10 2017

dev-master

9999999-dev

A simple utility to update the table style contained in the docx file.

  Sources   Download

MIT

The Requires

 

The Development Requires

by kojiro

22/10 2017

1.0.0

1.0.0.0

A simple utility to update the table style contained in the docx file.

  Sources   Download

MIT

The Requires

 

The Development Requires

by kojiro

06/09 2017

0.0.3

0.0.3.0

A simple utility to update the table style contained in the docx file.

  Sources   Download

MIT

The Requires

 

The Development Requires

by kojiro

10/08 2017

0.0.2

0.0.2.0

A simple utility to update the table style contained in the docx file.

  Sources   Download

MIT

The Requires

 

The Development Requires

by kojiro

05/07 2017

0.0.1

0.0.1.0

A simple utility to update the table style contained in the docx file.

  Sources   Download

MIT

The Requires

 

The Development Requires

by kojiro