Cannot combine large pdfs

PDF-XChange Editor SDK for Developers

Moderators: Tracker Support, TrackerSupp-Daniel, Sean - Tracker, Paul - Tracker Supp, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Ivan - Tracker Software, Tracker Supp-Stefan

Forum rules
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.

When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
Post Reply
prasantha
User
Posts: 29
Joined: Fri Jun 24, 2022 8:15 am

Cannot combine large pdfs

Post by prasantha »

Hi everyone,
I tried to combine around 400 files into a single file which willbe around 1.8 Gb in size after combine. I used the below code to combhine them
image.png
But some time it raise below exception, sometime it works well.
image(1).png
Can anybody let me know how to get rid of these errors.

It has much more free space available in memory, and I have set the /LARGEADDRESSAWARE flag onthe exe as well
zarkogajic
User
Posts: 1300
Joined: Thu Sep 05, 2019 12:35 pm

Re: Cannot combine large pdfs

Post by zarkogajic »

Hi,

32bit app ?

What does "IAUX_Inst::FormatHRESULT" say about that exception?

Look for memory usage in Task Manager (working set, peak, ...) - if it goes over 3GB ... bad luck...

-žarko
prasantha
User
Posts: 29
Joined: Fri Jun 24, 2022 8:15 am

Re: Cannot combine large pdfs

Post by prasantha »

Hi žarko,
Yes it is 32 bit app.

The error comes as soon as the memory usage goes over 1.4 GB (from task manager) fort he application , The workstation uses 6GB out of 8 GB when error occurs.
I cant track the exception further, because SDK itself shows error message and handle from sdk itself
zarkogajic
User
Posts: 1300
Joined: Thu Sep 05, 2019 12:35 pm

Re: Cannot combine large pdfs

Post by zarkogajic »

Hi,

32bit app on x86 or x64 Windows?

try/catch wrap the call to AsyncDoAndWait... and check for exception and then FormatHResult.



-žarko
User avatar
Lzcat - Tracker Supp
Site Admin
Posts: 668
Joined: Thu Jun 28, 2007 8:42 am

Re: Cannot combine large pdfs

Post by Lzcat - Tracker Supp »

Hi, prasantha

For the first, SDK was not intended to handle unlimited count of files at once. Opening each file require some memory and system resources, and because each process in Windows have serious limitation opening too many files at once was always a bad idea. Moreover, you are using 32-bit application, so you have very serious memory and address space limitations. Combining documents require that files must be opened and data from them must be transferred into other one, and during transferring we have two copies of data in memory - in original document and in resulting. So, in your case most optimal solution is not combining all files at once, but split work into smaller chunks. However, I'm not sure that 32-bit limitations will allow you to make final merge - expected 1.8 GB on disk may require much more than 3Gb memory to merge documents correctly. So I strongly recommend using 64-bit application instead of 32-bit one. If this is not possible for some reason your last chance will be using Insert pages instead of combine documents, inserting pages from each file at once and immediately closing source documents to reduce memory usage. But there is no guaranty that 32-bit code can handle such file correctly even in this case.

Kind regards,
Lzcat - Tracker Supp
Victor
Tracker Software
Project manager

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
zarkogajic
User
Posts: 1300
Joined: Thu Sep 05, 2019 12:35 pm

Re: Cannot combine large pdfs

Post by zarkogajic »

Hi Prasantha

Are you using the latest version of SDK?

I'm using code similar to what you have to combine way more than 400 files (some PDF, some Word, some Excel - so conversion also takes place during the process), size per single file is not more than 100MB.
32bit (IMAGE_FILE_LARGE_ADDRESS_AWARE) app on x64.
The total size of the saved combined file is 3.8 GB and it has ~73K pages !
Memory "Peek Working Set" never goes above 1.2 GB.

p.s.
Not using C# though.

@Victor: never mind if you've heard before: your SDK is awesome!

-žarko
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 15680
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Cannot combine large pdfs

Post by Tracker Supp-Stefan »

zarkogajic wrote: Thu Nov 24, 2022 9:42 pm @Victor: never mind if you've heard before: your SDK is awesome!
:D :D :D
Post Reply