Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!

Debenu Quick PDF Library - PDF SDK Community Forum Homepage
Forum Home Forum Home > For Users of the Library > I need help - I can help
  New Posts New Posts RSS Feed - Problems work with large files
  FAQ FAQ  Forum Search   Register Register  Login Login

Problems work with large files

 Post Reply Post Reply
Author
Message
Nick View Drop Down
Team Player
Team Player


Joined: 19 Dec 14
Location: USA
Status: Offline
Points: 28
Post Options Post Options   Thanks (0) Thanks(0)   Quote Nick Quote  Post ReplyReply Direct Link To This Post Topic: Problems work with large files
    Posted: 29 Dec 14 at 4:08PM
Every day I work with a lot of large files.
I have a problem.

QP.LoadFromFile ('big_18000pages.pdf', '');
QP.DeletePages (1,1);
QP.SaveToFile ('big_18000pages.pdf '); //'Out of memory'.

If there is a solution to this problem, the topic will be closed.

Thanks!
Back to Top
tfrost View Drop Down
Senior Member
Senior Member


Joined: 06 Sep 10
Location: UK
Status: Offline
Points: 437
Post Options Post Options   Thanks (0) Thanks(0)   Quote tfrost Quote  Post ReplyReply Direct Link To This Post Posted: 29 Dec 14 at 6:28PM
I do not have a file with 18000 pages to test, but if the problem is really a memory issue, you could try building with the 64-bit compiler and then adding as much RAM and paged memory as your application needs to manipulate the file in memory.  How big is your file?  What does Task Manager or Process Explorer report for your available memory?  What compiler version are you using?  What have you done already to quantify and investigate the issue?

Alternatively you could use the DA functions and simply hide the first page.  You probably will hardly notice the file size difference between that and deleting it.  If your real application involves more than just removing the one page, tell us what the real problem is, rather than just the example of the first failure.

Oh, and asking the same question twice will not get an answer quicker, especially during an extended holiday period.  And topics here remain available permanently, they are not closed, so that other users can benefit.

Back to Top
Nick View Drop Down
Team Player
Team Player


Joined: 19 Dec 14
Location: USA
Status: Offline
Points: 28
Post Options Post Options   Thanks (0) Thanks(0)   Quote Nick Quote  Post ReplyReply Direct Link To This Post Posted: 30 Dec 14 at 3:49PM
Dear tfrost!
Thank you very much for your attention on the eve of the New Year.
Delphi 7, Win 7, 6.00 GB, 64-bit.
My idea:
...
QP.AddToFileList('FilesToMerge', '01.pdf'); // File with source pushbutton.
QP.AddToFileList('FilesToMerge', '02.pdf'); // Here to insert pushbutton.
QP.MergeFileListFast('FilesToMerge', 'tmp.pdf');
QP.LoadFromFile('tmp.pdf', '');
Btn := QP.FindFormFieldByTitle('Button1');
QP.SetFormFieldPage(Btn,2);
QP.DeletePages(1,1);
QP.SaveToFile('02.pdf'); // If a large file, the message "Not enough memory".
DeleteFile('tmp.pdf');
...

Really works quickly and without any problems with small files.
Inserts button in 100 files for 5-6 seconds.

Happy New Year!
Back to Top
tfrost View Drop Down
Senior Member
Senior Member


Joined: 06 Sep 10
Location: UK
Status: Offline
Points: 437
Post Options Post Options   Thanks (0) Thanks(0)   Quote tfrost Quote  Post ReplyReply Direct Link To This Post Posted: 30 Dec 14 at 5:32PM
You are obviously out of luck with Delphi 7 to use all your 6GB of memory by compiling as 64-bit.  You need to monitor the available memory in your application to see how much you are short.  A standard 32-bit app will only access 2GB.  If you think that adding another GB will make the app work, you can add (in the DPR):

  {$SetPEFlags IMAGE_FILE_LARGE_ADDRESS_AWARE}

If that symbol is not defined in Windows.pas in D7, you can substitute its value, which is 32.  This will give your app up to 3GB either on a 64-bit OS, or on a 32-bit OS which has been configured (in BOOT.INI) to be 3GB aware.  Google LARGE_ADDRESS_AWARE if you are not familiar with all this.  However this is not worth trying if your calculations and estimates tell you that 3GB will also be insufficient.  Use Process Explorer or Task Manager at a breakpoint to see how much memory is used in your app with various PDF sizes which are below the failure size, then extrapolate to estimate how much a larger PDF will need.

Good luck and Happy New Year to you also!

Back to Top
Chopinke View Drop Down
Team Player
Team Player


Joined: 29 Apr 14
Status: Offline
Points: 24
Post Options Post Options   Thanks (0) Thanks(0)   Quote Chopinke Quote  Post ReplyReply Direct Link To This Post Posted: 27 Jan 15 at 10:28AM
Why don't you check out QP.DAxxxx functions, they are supposed to handle large files optimized...
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.

Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. AboutContactBlogSupportOnline Store