TE Edit Control .NET Core / .NET Framework Help
Product page

TerPageMetafile

Retrieve the page number containing the given line.

Metafile TerPageMetafile(PageNo)
Metafile TerPageMetafilePdf(PageNo)
int PageNo;Page number number (0 to TotalPages - 1)

Comment: Please use the TerPageMetafilePdf function when creating the metafile to pass to WinPDF converter, our product to generate pdf.

Return Value: This function returns the Metafile object containing the text for the page. The metafile is created in the MetafileFrameUnit.Document units (1/300 of an inch). A null values indicates an error condition.

If you wish to save the image of the page to a disk file in a format other than a metafile format, then please use the TerPageBitmap method instead.

When creating metafiles for multiple pages, it is efficient to sandwich multiple calls to the TerPageMetafile function between the calls to the TerSetPrintPreview function:

int TotalPages=tern.TerGetParam(tc.TP_TOTAL_PAGES);
tern.TerSetPrintPreview(true);  // start the document metafile
                                   output
for (int page=0;page<TotalPages;page++) {
  tern.TerPageMetafile(page);   
         // TerPageMetafile creates pages in 1/300 inches
            resolution
  TotalPages=tern.TerGetParam(tc.TP_TOTAL_PAGES);   
         // this line is needed only if the Tern control is NOT
            set to use page-mode
}
tern.TerSetPrintPreview(false); 
         // end the document metafile output