Heap corruption (page size about 2.5 m)

  • Hello WPCubed team,

    if I call "wpdf.DrawMetaFileEx (0,0,0,0,hMetafile,dpi,dpi)" twice in succession with the same (huge page) hMetafile as a parameter, then the first call succeeds, but the second attempt fails.


    The Delphi event log then shows lots of "Heap corruption detected at xxxxx" messages during the second call.

    This is with WPDF300A version 3.77.0.0.

    • Offizieller Beitrag

    Hi,

    in case your code creates an interemdiate bitmap, that will fails with a PDF with size of 5 meters.

    This depends on the features which are actually used, in general wPDF does not really care how large the resolution is.

    Julian

  • Hi Julian,

    no, the EMF does not create an intermediate bitmap. It is just a very large page with lots of text, lines and dashes and two small bitmaps.

    I am having problems with Acrobat Viewer, newer versions won't display my large pages (5m) anymore and my customers require an endless printout.

    So I need to find the "magical limit" of the page size.

    So for testing I created a page of 2.5 m and simply output the same metafile twice just to see if Adobe would swallow the two-page document.

    The first wpdf.DrawMetaFileEx() runs fine, the second causes heap errors.