CompressPage
页面属性
说明
本页介绍 PDFlibPas 中属于“页面属性”主题的 CompressPage。API 名称、参数、类名、文件名和字面量保持原样,以便和 Delphi 库及 DLL 入口点完全对应。
调用函数前请查看语法、参数和返回值。代码块保留原始形式,便于示例直接复制使用。 CompressContent, SelectPage, CompressContent
语法
Delphi
Function TPDFlib.CompressPage: Integer;
ActiveX
Function PDFlib::CompressPage() As Long
DLL
int DLCompressPage(int InstanceID);
返回值
| 0 | 此值说明 CompressPage 的调用结果。通常非零值表示成功,0 表示操作未完成。 |
|---|---|
| 1 | 此值说明 CompressPage 的调用结果。通常非零值表示成功,0 表示操作未完成。 |
备注
调用函数前请查看语法、参数和返回值。代码块保留原始形式,便于示例直接复制使用。
示例
// Compress every page individually so the UI can report progress
var
I, N: Integer;
begin
N := PDF.GetPageCount;
for I := 1 to N do
begin
PDF.SelectPage(I);
PDF.CompressPage;
ProgressBar1.Position := (I * 100) div N;
Application.ProcessMessages;
end;
PDF.SaveToFile('compressed.pdf');
end;另请参阅
CompressContent, CompressImages, CompressFonts, SelectPage, PageCount