PDFTool  6.0
Public Types | Public Member Functions | List of all members
PdfTk::PtlPDFDocument Class Reference

PDF文書を表現したクラスです。 More...

#include <PtlPDFDocument.h>

Public Types

enum  SAVE_OPTION { SAVE_RECONSTRUCT = 0, SAVE_LINEARIZE = 1, SAVE_INCREMENTAL_UPDATE = 2 }
 保存オプション More...
 

Public Member Functions

int getHandle () const
 
 PtlPDFDocument ()
 コンストラクタ More...
 
 PtlPDFDocument (const PtlPDFDocument &obj)
 コピーコンストラクタ alias copy More...
 
 ‾PtlPDFDocument ()
 デストラクタ
 
PtlPDFDocumentoperator= (const PtlPDFDocument &obj)
 コピーオペレータ alias copy More...
 
void setPassword (const PtlParamString &password)
 パスワードを設定。 More...
 
void load (PtlParamStream &inParam)
 PDF文書をロード。 More...
 
void setSaveOption (SAVE_OPTION option)
 保存時のオプションを設定。 More...
 
void save (PtlParamStream &outParam)
 PDF文書を保存。 More...
 
bool isEncrypted () const
 暗号化されているかどうかを取得。 More...
 
bool isEncryptedOnlyEmbeddedFiles () const
 添付ファイルのみ暗号化されているかどうかを取得。 More...
 
bool hasOwnerAuthority () const
 オーナー権限があるかどうかを取得。 More...
 
const PtlEncryptgetEncrypt ()
 暗号化情報を取得。 More...
 
void setEncrypt (const PtlEncrypt &encrypt)
 暗号化情報を設定。 More...
 
void removeEncrypt ()
 暗号化情報を削除。 More...
 
bool isSignatured () const
 署名付きかどうかを取得。 More...
 
bool isPDFA () const
 PDF/Aかどうかを取得。 More...
 
bool isPDFX () const
 PDF/Xかどうかを取得。 More...
 
PtlDocPropertygetDocProperty () const
 文書プロパティを取得。 More...
 
int getPageCount () const
 ページ数を取得。 More...
 
PtlPagesgetPages ()
 ページコンテナを取得。 More...
 
bool hasOutlines () const
 アウトラインを持っているかどうかを取得。 More...
 
PtlOutline getRootOutline () const
 ルートアウトラインを取得。 More...
 
bool hasEmbeddedFiles () const
 添付ファイルを持っているかどうかを取得。 More...
 
PtlEmbeddedFilesgetEmbeddedFiles () const
 添付ファイルコンテナを取得。 More...
 
void appendWaterMark (const PtlParamWaterMark &waterMark)
 透かしを設定。 More...
 
void removeWaterMark (const PtlParamString &name)
 透かしを削除。 More...
 
void setRestriction (const PtlParamRestriction &restriction)
 閲覧制限を設定。 More...
 
bool optimize (const PtlParamOptimize &paramOptimize)
 最適化。 More...
 
bool embedFonts ()
 フォント埋め込み。 More...
 
void importAnnotsFromFDF (PtlParamStream &inParam)
 FDF文書のインポート。 More...
 
void importAnnotsFromPDF (PtlParamStream &inParam)
 マークアップ注釈のPDFからのインポート。 More...
 
void exportAnnotsToFDF (PtlParamStream &outParam)
 FDF文書のエクスポート。 More...
 
int searchTextAndDoProcess (const PtlParamSearchText &paramSearchText)
 テキスト検索して後処理。 More...
 
PtlSearchTextResults searchText (const PtlParamSearchText &paramSearchText)
 テキスト検索。 More...
 

Detailed Description

PDF文書を表現したクラスです。

Member Enumeration Documentation

◆ SAVE_OPTION

保存オプション

Enumerator
SAVE_RECONSTRUCT 

再構築(デフォルト)

SAVE_LINEARIZE 

リニアライズ

SAVE_INCREMENTAL_UPDATE 

増分更新

Constructor & Destructor Documentation

◆ PtlPDFDocument() [1/2]

PdfTk::PtlPDFDocument::PtlPDFDocument ( )

コンストラクタ

Exceptions
PtlException

◆ PtlPDFDocument() [2/2]

PdfTk::PtlPDFDocument::PtlPDFDocument ( const PtlPDFDocument obj)

コピーコンストラクタ alias copy

Parameters
objコピー元オブジェクト。
Exceptions
PtlException

Member Function Documentation

◆ appendWaterMark()

void PdfTk::PtlPDFDocument::appendWaterMark ( const PtlParamWaterMark waterMark)

透かしを設定。

Parameters
waterMark透かしのパラメータ
Exceptions
PtlException

◆ embedFonts()

bool PdfTk::PtlPDFDocument::embedFonts ( )

フォント埋め込み。

埋め込まれていないフォントを埋め込みフォントにします。
※ 埋め込みに使われるフォントがインストールされていないと埋め込み対象であっても埋め込みされません。

Returns
true: フォント埋め込みされた、false: フォント埋め込みされない。
Exceptions
PtlException

◆ exportAnnotsToFDF()

void PdfTk::PtlPDFDocument::exportAnnotsToFDF ( PtlParamStream outParam)

FDF文書のエクスポート。

マークアップ注釈をFDFに書き出します。

Parameters
outParamOutputParam
Exceptions
PtlException

◆ getDocProperty()

PtlDocProperty& PdfTk::PtlPDFDocument::getDocProperty ( ) const

文書プロパティを取得。

Returns
文書プロパティ。
Exceptions
PtlException

◆ getEmbeddedFiles()

PtlEmbeddedFiles& PdfTk::PtlPDFDocument::getEmbeddedFiles ( ) const

添付ファイルコンテナを取得。

Returns
添付ファイルコンテナ。
Exceptions
PtlException

◆ getEncrypt()

const PtlEncrypt& PdfTk::PtlPDFDocument::getEncrypt ( )

暗号化情報を取得。

Returns
暗号化情報。PtlEncryptStandardType1若しくはPtlEncryptStandardType2。
Exceptions
PtlException

◆ getPageCount()

int PdfTk::PtlPDFDocument::getPageCount ( ) const

ページ数を取得。

Returns
ページ数

◆ getPages()

PtlPages& PdfTk::PtlPDFDocument::getPages ( )

ページコンテナを取得。

Returns
ページコンテナ。
Exceptions
PtlException

◆ getRootOutline()

PtlOutline PdfTk::PtlPDFDocument::getRootOutline ( ) const

ルートアウトラインを取得。

ルートは仮想のしおりで一番上位にあり、他のしおりをたどっていく基点となります。
アウトラインを持っていなくてもルートは取得されます。

Returns
ルートアウトライン。
Exceptions
PtlException

◆ hasEmbeddedFiles()

bool PdfTk::PtlPDFDocument::hasEmbeddedFiles ( ) const

添付ファイルを持っているかどうかを取得。

Returns
true: 持っている、false: 持っていない。
Exceptions
PtlException

◆ hasOutlines()

bool PdfTk::PtlPDFDocument::hasOutlines ( ) const

アウトラインを持っているかどうかを取得。

Returns
true: 持っている、false: 持っていない。
Exceptions
PtlException

◆ hasOwnerAuthority()

bool PdfTk::PtlPDFDocument::hasOwnerAuthority ( ) const

オーナー権限があるかどうかを取得。

暗号化されていない場合、hasOwnerAuthorityはfalseです。

暗号化されている場合は下記の通りです。

ユーザーパスワード/オーナーパスワードの両方が設定されている場合、
ユーザーパスワードでloadするとhasOwnerAuthorityはfalseです。
オーナーパスワードでloadするとhasOwnerAuthorityはtrueです。

ユーザーパスワードのみが設定されている場合、
ユーザーパスワードでloadするとhasOwnerAuthorityはtrueです。

オーナーパスワードのみが設定されている場合、
オーナーパスワードでloadするとhasOwnerAuthorityはtrueです。
パスワードの設定なしでloadするとhasOwnerAuthorityはfalseです。

Returns
true: 暗号化されている、false: 暗号化されていない。
Exceptions
PtlException

◆ importAnnotsFromFDF()

void PdfTk::PtlPDFDocument::importAnnotsFromFDF ( PtlParamStream inParam)

FDF文書のインポート。

マークアップ注釈をFDFから取り込みます。

Parameters
inParamInputParam
Exceptions
PtlException

◆ importAnnotsFromPDF()

void PdfTk::PtlPDFDocument::importAnnotsFromPDF ( PtlParamStream inParam)

マークアップ注釈のPDFからのインポート。

マークアップ注釈をPDFから取り込みます。

Parameters
inParamInputParam
Exceptions
PtlException

◆ isEncrypted()

bool PdfTk::PtlPDFDocument::isEncrypted ( ) const

暗号化されているかどうかを取得。

Returns
true: 暗号化されている、false: 暗号化されていない。
Exceptions
PtlException

◆ isEncryptedOnlyEmbeddedFiles()

bool PdfTk::PtlPDFDocument::isEncryptedOnlyEmbeddedFiles ( ) const

添付ファイルのみ暗号化されているかどうかを取得。

Returns
true: 暗号化されている、false: 暗号化されていない。
Exceptions
PtlException

◆ isPDFA()

bool PdfTk::PtlPDFDocument::isPDFA ( ) const

PDF/Aかどうかを取得。

Returns
true: PDF/A、false: PDF/Aでない。
Exceptions
PtlException

◆ isPDFX()

bool PdfTk::PtlPDFDocument::isPDFX ( ) const

PDF/Xかどうかを取得。

Returns
true: PDF/X、false: PDF/Xでない。
Exceptions
PtlException

◆ isSignatured()

bool PdfTk::PtlPDFDocument::isSignatured ( ) const

署名付きかどうかを取得。

Returns
true: 署名付き、false: 署名付きでない。
Exceptions
PtlException

◆ load()

void PdfTk::PtlPDFDocument::load ( PtlParamStream inParam)

PDF文書をロード。

Parameters
inParamInputParam
Exceptions
PtlException

◆ operator=()

PtlPDFDocument& PdfTk::PtlPDFDocument::operator= ( const PtlPDFDocument obj)

コピーオペレータ alias copy

Parameters
objコピー元オブジェクト。

◆ optimize()

bool PdfTk::PtlPDFDocument::optimize ( const PtlParamOptimize paramOptimize)

最適化。

Parameters
paramOptimize最適化のパラメータ
Returns
true: 最適化された、false: 最適化されない。
Exceptions
PtlException

◆ removeEncrypt()

void PdfTk::PtlPDFDocument::removeEncrypt ( )

暗号化情報を削除。

Exceptions
PtlException

◆ removeWaterMark()

void PdfTk::PtlPDFDocument::removeWaterMark ( const PtlParamString name)

透かしを削除。

Parameters
name削除する透かしの名前
Exceptions
PtlException

◆ save()

void PdfTk::PtlPDFDocument::save ( PtlParamStream outParam)

PDF文書を保存。

Parameters
outParamOutputParam
Exceptions
PtlException

◆ searchText()

PtlSearchTextResults PdfTk::PtlPDFDocument::searchText ( const PtlParamSearchText paramSearchText)

テキスト検索。

検索できるのはユニコードとして文字を取得できるもののみです。
またテキストに見えても実際は画像であったりパスであったりする場合もこれらは検索対象となりません。

Parameters
paramSearchTextテキスト検索のパラメータ
Returns
PtlSearchTextResults。
Exceptions
PtlException

◆ searchTextAndDoProcess()

int PdfTk::PtlPDFDocument::searchTextAndDoProcess ( const PtlParamSearchText paramSearchText)

テキスト検索して後処理。

検索できるのはユニコードとして文字を取得できるもののみです。
またテキストに見えても実際は画像であったりパスであったりする場合もこれらは検索対象となりません。
パラメータとしてPtlParamSearchTextAndHighlightが使用された場合は、検索された文字列に対してHighlight注釈処理が行われます。
パラメータとしてPtlParamSearchTextAndSetMaskが使用された場合は、検索された文字列に対してMask処理が行われます。
※ 注意事項
Mask処理は検索されたものは無条件に処理されます。
定型文書でない一般文書などでは想定外のテキストがMask処理されてしまうことがありますのでこの関数の使用には
十分注意して下さい。
(例) "元日", "本日"のようにテキストが取得された場合、"日本"で検索するとヒットして"日"と"本"は削除されていまいます。

Parameters
paramSearchTextテキスト検索のパラメータ(PtlParamSearchTextAndHighlight若しくはPtlParamSearchTextAndSetMask)
Returns
検索されたテキストの数。
Exceptions
PtlException

◆ setEncrypt()

void PdfTk::PtlPDFDocument::setEncrypt ( const PtlEncrypt encrypt)

暗号化情報を設定。

※ 制限事項
元のPDFの暗号化が256ビットAES暗号化でユーザーパスワードとオーナーパスワードが設定されている場合に制限事項があります。
256ビットAES暗号化以外の暗号化に変更しユーザーパスワードを元のままとしたい場合はPtlEncryptStandardのsetUserPasswordで
元のユーザーパスワードを設定する必要があります。

Parameters
encrypt暗号化情報
Exceptions
PtlException

◆ setPassword()

void PdfTk::PtlPDFDocument::setPassword ( const PtlParamString password)

パスワードを設定。

Parameters
passwordパスワード。
Exceptions
PtlException

◆ setRestriction()

void PdfTk::PtlPDFDocument::setRestriction ( const PtlParamRestriction restriction)

閲覧制限を設定。

注意:
閲覧制限の内容を解析されないようオーナーパスワードの設定は必ず行ってください。

Parameters
restriction閲覧制限のパラメータ
Exceptions
PtlException

◆ setSaveOption()

void PdfTk::PtlPDFDocument::setSaveOption ( SAVE_OPTION  option)

保存時のオプションを設定。

オプションを設定しないと再構築して保存されます。

Parameters
option保存オプション。
Exceptions
PtlException