Page 1 of 1

PrintPreview - TMetafileList storage file size limit (2GB)

PostPosted: January 14th, 2019, 10:00 am
by mitzix
Hi,
I found problem when there's a lot of pages to print. When TMetafileList.Storage temp file exceeds 2GB boundary it is not possible to display or print pages retrieved from this file (not cached). It is due to bad variable types in Delphi Vcl.Graphics.TMetafile methods (e.g. TestEMF) where Size variable is declared as Longint instead of Int64. It can be overriden with class hack but there's bigger problem. It seems that TEnhMetaHeader declared in Windows cannot be used with big files (>2GB) due to its member offDescription declared as DWORD. This type is used in whole TMetafile class. This issue affects all Delphi versions up to Rio.
Only solution I see is to split TMetafileList storage file to multiple parts less than 2GB or save each page in separate file. Can you please fix this issue?

Re: PrintPreview - TMetafileList storage file size limit (2G

PostPosted: February 6th, 2019, 8:31 pm
by VPC16
Or have an error flag that the memory has been reached to exit gracefully. Looking at this but this option is not obvious, may need a new Method.

Re: PrintPreview - TMetafileList storage file size limit (2G

PostPosted: February 10th, 2019, 10:48 am
by Kambiz
Hi,

Having a 2GB of preview content is too much.
Would it be better to render only pages that the user view?