PDF Creator Pilot documentation |
Download CHM version of this manual. |
|
![]() ![]() Collapse AllReturns the size in bytes of a PDF file generated in memory.
|
| LONG MemoryFileSize { get; } |
Value
Size in bytes of a PDF file generated in memory.
Remarks
You can use the MemoryFileSize property to get the size in bytes of an in-memory generated file. The property works only if the GenerateInMemoryFile property is TRUE. To use this property in the full version of the library, you must have an additional Web License.
Analogue in new interface: IPDFDocument4::GetBufferSize.
Example
How to create a PDF document and return the data in the web application with the Response abstract class
Delphi
[copy to clipboard]
{ PDF object is supposed to be created }
PDF.StartEngine('demo', 'demo');
PDF.GenerateInMemoryFile := true;
PDF.BeginDoc;
{ some operations here... }
PDF.EndDoc;
Response.Clear;
Response.ContentType := 'application/pdf';
Response.AddHeader('Content-Type', 'application/pdf');
Response.AddHeader('Content-Disposition', 'inline;filename=form.pdf');
Response.AddHeader('Content-Length', PDF.MemoryFileSize);
Response.BinaryWrite(PDF.BinaryImage);
Response.End;
C/C++
[copy to clipboard]
// PDF object is supposed to be created
PDF->StartEngine("demo", "demo");
PDF->GenerateInMemoryFile = TRUE;
PDF->BeginDoc();
// some operations here...
PDF->EndDoc();
Response->Clear();
Response->ContentType = "application/pdf";
Response->AddHeader("Content-Type", "application/pdf");
Response->AddHeader("Content-Disposition", "inline;filename=form.pdf");
Response->AddHeader("Content-Length", itoa(PDF.MemoryFileSize));
Response->BinaryWrite(PDF->BinaryImage);
Response->End();
C#
[copy to clipboard]
// PDF object is supposed to be created
PDF.StartEngine("demo", "demo");
PDF.GenerateInMemoryFile = true;
PDF.BeginDoc();
// some operations here...
PDF.EndDoc();
Response.Clear();
Response.ContentType = "application/pdf";
Response.AddHeader("Content-Disposition", "inline;filename=form.pdf");
Response.AddHeader("Content-Length", PDF.MemoryFileSize.ToString());
Response.BinaryWrite(PDF.BinaryImage);
Response.End();
Visual Basic
[copy to clipboard]
' PDF object is supposed to be created
PDF.StartEngine("demo", "demo")
PDF.GenerateInMemoryFile = True
PDF.BeginDoc
' some operations here...
PDF.EndDoc
Response.Clear
Response.ContentType = "application/pdf"'
Response.AddHeader "Content-Type", "application/pdf"
Response.AddHeader "Content-Disposition", "inline;filename=form.pdf"
Response.AddHeader "Content-Length", PDF.MemoryFileSize
Response.BinaryWrite PDF.BinaryImage
Response.End
See Also
Reference


