Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
ABBYY FineReader Engine API の PDFAttachment オブジェクト(IPDFAttachment インターフェイス)— 元のファイル名、説明、関連付けの種類を持つ PDF 添付ファイルを表し、添付ファイルをディスクまたはグローバルメモリに保存するメソッドを提供します。
C++ (COM) コード
FREngine::IEnginePtr Engine; FREngine::IFRDocumentPtr sourceFile = Engine->CreateFRDocument(); sourceFile->AddImageFile( imageFilePath, 0, 0 ); // ソースドキュメントから添付ファイルのコレクションを取得 FREngine::IPDFAttachmentsPtr attachments; sourceFile->get_PDFAttachments( &attachments ); int attachmentsCount( 0 ); attachments->get_Count( &attachmentsCount ); // 処理用に、添付ファイル内の画像を新しいドキュメントに追加 FREngine::IFRDocumentPtr frDocument = Engine->CreateFRDocument(); for( int j = 0; j < attachmentsCount; j++ ) { FREngine::IPDFAttachmentPtr attach; attachments->get_Element( j, &attach ); FREngine::ImageFileFormatEnum fileFormat( FREngine::IFF_UnknownFormat ); attach->get_FileFormat( &fileFormat ); // サポートされている ImageFileFormatEnum のみ処理できます if( fileFormat != FREngine::IFF_UnknownFormat ) { frDocument->AddImageFileFromAttachment( attach, 0, 0, 0 ); } else { // すべての添付ファイルを保存できます BSTR fileName; attach->get_FileName( &fileName ); attach->SaveToFile( fileName ); } } // ドキュメントを認識 frDocument->Process( 0 );
このページは役に立ちましたか?