Components for Developers
© 2000-2012, Two Pilots

PDF Library Download Features Manual Tutorials FAQ Pricing HTML2PDF-X Pilot History In the Lab

PDF Creator Pilot documentation

Download CHM version of this manual.
General document methods
Abort
Aborted
AddColorTransformationRule
AddImageFromBitmapHandle
AddImageFromBuffer
AddImageFromFile
AddImageFromFilename
AddImageFromMemory
AddImageWithColorMask
AddImageWithMask
AddTTFFontFromFile
AddTTFFontFromFile2
AddType1FontFromFile
AutoCreateURL
AutoLaunch
BeginDoc
BinaryImage
Compression
CreateWaterMark
CurrentWaterMarkIndex
DocumentInfo_Author
DocumentInfo_CreationDate
DocumentInfo_Creator
DocumentInfo_Keywords
DocumentInfo_Producer
DocumentInfo_Subject
DocumentInfo_Title
EndDoc
FileName
FlipImage
FontEmbedStyle
GenerateInMemoryFile
GetCurrentPageIndex
GetImageCount
GetImageHeight
GetImageResolution
GetImageWidth
GetUsedDC
GetUsedDCResolution
GlyphsToUnicodeStr
HDC
InitialZoom
InitialZoom2
JPEGQuality
LastError
LoadICCProfile
LogActionsAndErrors
LogTextOperation
MakeImageGrayScale
MakeImageNegative
MemoryFileSize
MetafileImagesCompressionType
MetafileImagesJpegCompression
NewPage
NonEmbeddedFonts
NonEmbeddedFonts_Add
NotEmbedAnyFonts
OnePass
OutputByteStream
OwnerPassword
PageCount
PageHeight
PageLayout
PageMode
PageNumber
PageWidth
PlaceImageToCurrentPage
PlayEMF
PrinterForVirtualDC
Printing
ProducePDFA
ProtectionEnabled
ProtectionKeyLength
ProtectionOptions_coAssembly
ProtectionOptions_coCopyInformation
ProtectionOptions_coExtractInfo
ProtectionOptions_coFillAnnotation
ProtectionOptions_coModifyAnnotation
ProtectionOptions_coModifyStructure
ProtectionOptions_coPrint
ProtectionOptions_coPrintHigh
Resolution
SetCurrentPage
SetPDFAOutputIntent
SetPDFXOutputIntent
StartEngine
SwitchedToWatermark
TransformColors
UseCurrentDocumentResolutionForNextPages
UserPassword
UseScreenDC
Version
ViewerPreferences_vpCenterWindow
ViewerPreferences_vpFitWindow
ViewerPreferences_vpHideMenuBar
ViewerPreferences_vpHideToolBar
ViewerPreferences_vpHideWindowUI
Collapse All

This property returns the size (in bytes) of a PDF file generated in memory.

Syntax

LONG MemoryFileSize { get; }
Value
Size (in bytes) of a PDF file generated in memory

Remarks

ou can use the MemoryFileSize property to get the size of a file generated in memory. The property works only if the GenerateInMemoryFile property is VARIANT_TRUE. To use this property in the full version of the library, you must have an additional Web license.

Equivalent in new interface: IPDFDocument4::GetBufferSize.

Example

How to Create a PDF Document and Return the Data in a Web Application with the Abstract Response 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

PDF Library Download Features Manual Tutorials FAQ Pricing HTML2PDF-X Pilot History In the Lab

 

 

PDF Library | Virtual Printer | Converters to PDF

Support | Blog | Forum | Contacts

© 2000-2012, Two Pilots