THotPDF.CopyPageFromDocument 메서드

 

THotPDF.CopyPageFromDocument

THotPDF

 

맨 위  이전  다음

Copies page from source document  to the current document.

 

Delphi 구문:

procedure CopyPageFromDocument (  SourceDoc: THotPDF;  SourceIndex: Integer;  DestIndex: Integer  );

 

C++ 구문:

void __fastcall CopyPageFromDocument ( THotPDF * SourceDoc, int SourceIndex, int DestIndex );

 

설명

CopyPageFromDocument를 호출하면 SourceDoc document의 SourceIndex page를 current document의 DestIndex page로 복사합니다

Copied page는 embedded CID TrueType font를 포함한 page resource와 content stream을 유지하므로, 여러 source document에서 page를 merge할 때 이 method를 반복해서 사용할 수 있습니다

Page dictionary, resource dictionary, array, object stream에서 복사된 PDF name value는 HotPDF가 다시 쓰기 전에 ISO 32000-1 #XX escape form에서 decode됩니다. 이렇게 하면 /PANTONE#20216#20CVC 또는 /application#2Fxml 같은 source name이 double-escaped number sign으로 emit되는 것을 방지합니다

 

 

Code Example

// Copy page from existing PDF to new PDF
var
  SourcePDF: THotPDF;

begin
  SourcePDF := THotPDF.Create( nil );
  try
    SourcePDF.LoadFromFile( 'c:\Source.pdf' );

    HPDF.BeginDoc;
    HPDF.CopyPageFromDocument( SourcePDF, 1 );   // Copy page 1 from source document
    HPDF.EndDoc;
  finally
    SourcePDF.Free;
  end;
end;