ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Out Of Memory in ImageEnMViewLoad.MIO.SaveToFilePDF(_fileIn);
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

tiagosis

Brazil
44 Posts

Posted - Apr 15 2025 :  16:14:10  Show Profile  Reply
Hello, we are getting "out of memory" in "ImageEnMViewLoad.MIO.SaveToFilePDF(_fileIn);"
after "ImageEnMViewLoad.MIO.Acquire;" scanning in color at 400 dpi. What can I do to solve this? I am compiling my project for 32 bits.

tiago

xequte

38948 Posts

Posted - Apr 15 2025 :  20:40:12  Show Profile  Reply
Hi

What are the dimensions of the images in your TImageEnMView? How many are there?

What is your PDF engine?

http://www.imageen.com/help/TIEGlobalSettings.ActivePDFEngine.html

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

tiagosis

Brazil
44 Posts

Posted - Apr 16 2025 :  15:28:22  Show Profile  Reply
Please, this was not happening in the previous version, I updated to the latest version of ImageEN and my routine started generating this error, how can I solve it?
plain a4 paper.


   //caso exista mais de um scanner, vai pedir para selecionar.
    if (ImageEnMViewLoad.MIO.TwainParams.SourceCount > 1) then
    begin
      if not (ImageEnMViewLoad.MIO.SelectAcquireSource) then
        Exit;
    end;

    ImageEnMViewLoad.Clear;
    ImageEnMViewLoad.MIO.TwainParams.VisibleDialog := true;
    ImageEnMViewLoad.StoreType := ietNormal;
    ImageEnMViewLoad.MIO.Acquire;

    TrimAppMemorySize;
    if ImageEnMViewLoad.ImageCount > 0 then
    begin
      try
        createTmpDirectoryPDF;
        //gerando pdfStream
        //str := TMemoryStream.Create;
        _fileIn  := _pathTemp + IntToStr(Random(9999)) + '.PDF';
        _fileOut := _pathTemp + IntToStr(Random(9999)) + '.PDF';
        ImageEnMViewLoad.MIO.SaveToFilePDF(_fileIn);

        compressPDF(_fileIn,_fileOut,true);
        //ImageEnMViewLoad.MIO.SaveToStreamPDF(str);
        //str.Position := 0;

        TrimAppMemorySize;

        //carregando pdf para um image de apoio
        ImgLoad.PdfViewer.Enabled := true;
        //ImgLoad.PdfViewer.Document.LoadFromStream(str);
        ImgLoad.PdfViewer.Document.LoadFromFile(_fileOut);

        //caso tenham imagens...
        if (ImgLoad.PdfViewer.PageCount > 0) then
        begin
          //PDFPrint.Document.LoadFromStream(str);
          PDFPrint.Document.LoadFromFile(_fileOut);
          //str.Position := 0;
          ImageEnView1.PdfViewer.Enabled := true;
          ImageEnView1.PdfViewer.ShowAllPages := true;
          if (ImageEnView1.PdfViewer.PageCount > 0) then
            ImageEnView1.PdfViewer.Document.ImportPages(ImgLoad.PdfViewer.Document,PAGE_RANGE_ALL,-1)
          else
            //ImageEnView1.PdfViewer.LoadFromStream(str);
            ImageEnView1.PdfViewer.LoadFromFile(_fileOut);

          refreshPDFViewer;
          updateStatus;
          _Digitalizou := True;
          _Sair := False;
        end;
      finally
        clearDirectory(_pathTemp);
        TrimAppMemorySize;
        //FreeAndNil(str);
      end;
    end;


tiago
Go to Top of Page

xequte

38948 Posts

Posted - Apr 16 2025 :  19:00:28  Show Profile  Reply
Hi Tiago

Is it resolved if you set:

IEGlobalSettings().PDFEngine := ieenNative;


Nigel
Xequte Software
www.imageen.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: