|
กำหนดสตรีมเอาต์พุตสำหรับไฟล์ที่สร้างขึ้นในหน่วยความจำ
Delphi syntax:
property OutputStream: TStream;
C++ syntax:
__property TStream * OutputStream;
คำอธิบาย
ใช้ OutputStream เพื่อรับ TStream สำหรับไฟล์ที่สร้างขึ้นในหน่วยความจำ
Code Example
var
MemStream: TMemoryStream;
begin
MemStream := TMemoryStream.Create;
try
HPDF.OutputStream := MemStream; // Set output to memory stream
HPDF.BeginDoc;
HPDF.CurrentPage.TextOut( 100, 100, 'PDF content in memory' );
HPDF.EndDoc;
// Now MemStream contains the PDF data
MemStream.SaveToFile( 'output.pdf' ); // Save stream to file
finally
MemStream.Free;
end;
end;
|