PDF Creator Pilot documentation |
Download CHM version of this manual. |
|
![]() ![]() Collapse AllReturns a generated PDF document as a byte array.
|
| VARIANT BinaryImage { get; } |
Value
Array of bytes representing the PDF document.
Remarks
BinaryImage returns a generated PDF file as a byte array and can be used within functions for streaming output to PDF. The property is available only with PDF documents created in memory when GenerateInMemoryFile is TRUE. To use this property in the full version of the library, you must have an additional Web License.
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((byte*)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((byte[])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


