Documentation Index Fetch the complete documentation index at: https://docs.abbyy.com/llms.txt
Use this file to discover all available pages before exploring further.
이 메서드는 지정한 이미지 파일을 열고, 열린 파일에 해당하는 페이지를 문서에 추가합니다.
HRESULT AddImageFile (
BSTR ImageFileName ,
IPrepareImageMode * PrepareMode ,
IIntsCollection * PageIndices
);
void AddImageFile(
string ImageFileName,
IPrepareImageMode PrepareMode,
IIntsCollection PageIndices
);
Sub AddImageFile ( _
ImageFileName As String , _
[PrepareMode As IPrepareImageMode = Nothing ], _
[PageIndices As IIntsCollection = Nothing ] _
)
ImageFileName
[in] 이 변수에는 열려는 이미지 파일의 전체 경로가 들어 있습니다.
PrepareMode
[in] 이 매개변수는 이미지를 열 때 이미지가 어떻게 전처리될지를 지정하는 PrepareImageMode 객체를 나타냅니다.
PageIndices
[in] 이 매개변수는 문서에 추가할 페이지의 인덱스를 지정하는 IntsCollection 객체를 나타냅니다. 중복된 인덱스는 허용되지 않습니다. 같은 페이지를 여러 번 추가하려면 이 메서드를 여러 번 호출하십시오. 이 매개변수는 선택 사항이며 0일 수 있습니다. 이 경우 열린 파일의 모든 페이지가 문서에 추가됩니다.
이 메서드에는 별도의 반환 값이 없습니다. ABBYY FineReader Engine 함수의 표준 반환 값 이 반환됩니다.
이 메서드를 사용하여 PDF 포트폴리오 파일을 열면 표지가 항상 출력 파일에 포함됩니다.
이 메서드는 FRDocument 객체의 IConnectionPointContainer 인터페이스에 연결된 리스너에 이벤트를 보고할 수 있습니다.
Linux 및 Windows의 경우:
이 Windows 샘플은 페이지를 문서에 추가하는 작업이 지나치게 오래 걸릴 경우 해당 작업을 중단하는 방법을 보여 줍니다.
// 이미지 파일 로드에 너무 오래 걸릴 경우를 대비해 시간 제한을 활성화합니다
frDocumentCallback . SetShouldTrackTime ( true );
frDocumentCallback . FlushTimer ();
// 이미지 파일을 열기 위해 AddImageFile 메서드를 호출합니다
CheckResult ( frDocument -> AddImageFile ( imageFilePath, 0 , pageIndices ) );
// 이후 처리에서는 시간 제한을 비활성화합니다
frDocumentCallback . SetShouldTrackTime ( false );
...
// 이벤트 보고에 IFRDocumentEvents 콜백 인터페이스를 사용합니다
class CFRDocumentCallback : public IFRDocumentEvents {
public:
CFRDocumentCallback () : startTime ( 0 ) {}
// IUnknown 메서드를 구현합니다
ULONG STDMETHODCALLTYPE AddRef () { return 1 ; }
ULONG STDMETHODCALLTYPE Release () { return 1 ; }
HRESULT STDMETHODCALLTYPE QueryInterface ( REFIID riid, void ** ppObject );
HRESULT STDMETHODCALLTYPE OnProgress ( IFRDocument * document, int percentage, VARIANT_BOOL * ShouldContinue );
HRESULT STDMETHODCALLTYPE OnWarning ( IFRDocument * frPage, int pageNumber, BSTR recognizerTip,
VARIANT_BOOL * ShouldContinue );
HRESULT STDMETHODCALLTYPE OnPageProcessed ( IFRDocument * document, int pageNumber, PageProcessingStageEnum stage );
void FlushTimer ();
void SetShouldTrackTime ( bool _shouldTrackTime );
private:
time_t startTime;
bool shouldTrackTime = true ;
};
// startTime를 재설정하려면 FlushTimer 메서드를 호출합니다
void CFRDocumentCallback :: FlushTimer () {
time ( & startTime );
}
// 이 콜백은 다른 메서드에서도 사용할 수 있으므로, 더 이상 시간 제한을 재설정하지 않으려면 shouldTrackTime을 FALSE로 설정합니다
void CFRDocumentCallback :: SetShouldTrackTime ( bool _shouldTrackTime ) {
shouldTrackTime = _shouldTrackTime;
}
// 현재 시간과 "startTime"의 차이가 특정 임곗값을 초과하면 프로세스가 중단됩니다. AddImageFile 메서드는 OnProgress 메서드에 percentage 대신 0을 전달합니다
HRESULT STDMETHODCALLTYPE CFRDocumentCallback :: OnProgress ( IFRDocument * frDocument, int percentage,
VARIANT_BOOL * shouldTerminate )
{
if ( shouldTrackTime ) {
time_t currentTime;
time ( ¤tTime );
double seconds = difftime ( currentTime, startTime );
printf ( " %f \n " , seconds );
* shouldTerminate = ( seconds > 100 ? VARIANT_TRUE : VARIANT_FALSE );
}
return S_OK;
}
이 메서드는 EventsHandling 및 문서 비교 코드 샘플과 Windows 문서 비교 데모 도구에서 사용됩니다.
FRDocument
AddImageFileWithPassword
AddImageFileWithPasswordCallback
AddImageDocument
이미지 작업