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!
LoadFromFile fails after doing a MergeFileListFast |
Post Reply |
Author | |
jhuang
Beginner Joined: 28 Jul 06 Location: United States Status: Offline Points: 5 |
Post Options
Thanks(0)
Posted: 10 Aug 11 at 6:59AM |
I am using QuickPDFLibray 0726 in C# to generate a PDF file from 7500 PDF files that will result in a 350Mb to 500Mb PDF file. This is the extreme case that I need to support and I am having problems at the end when I am trying to load the 350Mb to 500Mb PDF file. The code goes something like this:
for ( int i = 0; i <= 7500; i++ )
{
oPDF.AddToFileList("BigFile", @"D:\Temp\" + i.ToString() + ".pdf");
}
oPDF.MergeFileListFast("BigFile", @"D\Output\BigFile.pdf");
oPDF.ClearFileList("BigFile");
if ( oPDF.LoadFromFile(@"D\Output\BigFile.pdf") == 0 )
{
throw new Exception
}
/* Perform logic to generate outlines/bookmarks for all the included pdf files. */
Unfortunately I keep on getting a 0 result when I load large files. I started noticing them at 300Mb. I haven't worked backwards in file size to see if there is a lower limit. All I know is that the code works fine when then output file is not this large.
I tried loading the file using the DA functions. They opened the large files without generating an error. But DAs don't have the capability to manipulate the PDF outlines/ bookmarks, which is what I need.
I noticed that if I loaded a large file only, it would load fine. However, performing all that logic together is what is causing the large files to not load properly.
Any ideas on what could be causing my large files to not load properly?
Thanks.
|
|
AndrewC
Moderator Group Joined: 08 Dec 10 Location: Geelong, Aust Status: Offline Points: 841 |
Post Options
Thanks(0)
|
Have you checked how much memory your process is using in the Task Manager as your program is running. One other option may be to make two smaller files (3750 pages long) and merge the two files at the end and see if that causes any issues.
Andrew.
|
|
jhuang
Beginner Joined: 28 Jul 06 Location: United States Status: Offline Points: 5 |
Post Options
Thanks(0)
|
I was just checking the Task Manager and there seems to be plenty of memory to load the large file. If there is a specific counter that I should be watching out for, please let me know.
Also, I tried breaking the file into 2 as suggested and it still failed to load. I even tried loading 2 files that are 165Mb each and it failed right away trying to load the first file.
|
|
AndrewC
Moderator Group Joined: 08 Dec 10 Location: Geelong, Aust Status: Offline Points: 841 |
Post Options
Thanks(0)
|
Just the overall Memory (Private Working Set) ? It your app gets to 500,000K+ then you could start having problems depending on how much main memory you have. My 8GB machine can get to 1.3GB but not much further before problems start to happen.
Could it be that the 1st 165MB file is corrupt ? Does it load into Acrobat still ? Andrew
|
|
jhuang
Beginner Joined: 28 Jul 06 Location: United States Status: Offline Points: 5 |
Post Options
Thanks(0)
|
I was using the Process Explorer and tracking the Virtual Memory Size. Before loading a 165+MB file, the size was at ~380Mb. Everytime this scenario happened, the load would fail. I created a new project and just did a load of the same file and it would load fine. In this case, the Virtual Size was in the low 100Mb before the load. With this information, I was able to track down the culprit of my problem... Crystal Reports. Everytime I loaded any CR report, the Virtual Size would jump over 100Mb. It would release a small amout of memory as I unloaded the report but it would never release the whole thing. This seems to be a known problem. Anyway, I now just need to figure out how to generate the CR reports reports without CR and I'll be back in business. At the very least, I have something to look into now.
By the way, I was looking at the Working Set values and they typically hang around the high 100Mb but not more. I'll keep my eye out for this value as well as I work this out.
Thanks for the help.
|
|
Cuspide
Team Player Joined: 25 May 10 Status: Offline Points: 21 |
Post Options
Thanks(0)
|
I take this discussion as I had the same problem. ActiveX v.8.13 After using MergeFileListFast - LoadFromFile trying to execute the file is not opened,returning 0. I used a different object to make the LoadFromFile ... but the result does not change. It must be said that if I open the file you just created with the Acrobat Reader MergeFileListFast through the file appears (page number 2670) If the file is opened with DAOpenFileReadOnly no feedback problems, but in this way I can manipulate the files. thanks Daniele |
|
Cuspide
Team Player Joined: 25 May 10 Status: Offline Points: 21 |
Post Options
Thanks(0)
|
Can anyone help me?
|
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
Hi Daniele!
It's not good jumping on a running thread - initiate a new one ;-)
The other thing:
Without a code snippet there's not much to say to your problem.
Cheers, Ingo
|
|
Cuspide
Team Player Joined: 25 May 10 Status: Offline Points: 21 |
Post Options
Thanks(0)
|
Hi Ingo,
I did not want to open a new thread. Code: Call oPDF.MergeFileListFast("LIST", pNomeFile) If mTipoStp = "PDF" Then If Trim(pPdf) <> "" Then result = oPDF2.UnlockKey(LICENSEKEY) If result = 1 Then If FileExists(pNomeFile) = True Then 'oPDF2.LoadFromFile pNomeFile, "" rEncode = oPDF2.EncodePermissions(1, 0, 0, 0, 0, 0, 0, 1) Call oPDF2.EncryptFile(pNomeFile, pNomeFile & "_@", pPdf, pPdf, 1, rEncode) Kill pNomeFile Name pNomeFile & "_@" As pNomeFile End If End If End If End if The MergeFileFast provides a file of about 100mb. If I place the EncryptFile I have no problem But if I try this with me LoadFromFile returns 0 and we can not understand the motivation. Thanks Daniele
|
|
AndrewC
Moderator Group Joined: 08 Dec 10 Location: Geelong, Aust Status: Offline Points: 841 |
Post Options
Thanks(0)
|
There could be a problem with the PDF - for example it might have a syntax error which is causing strange behaviour - like a bad xref table.
What value does MergeFileListFast return ? When LoadFromFile returns 0 you may want to check the return value of QP.LastErrorCode(). |
|
Cuspide
Team Player Joined: 25 May 10 Status: Offline Points: 21 |
Post Options
Thanks(0)
|
Hi Andrew,
thanks for the answer. We tried to run only a LoadFromFile file size: 101Mb ... LastErrorCode return err. N.401: Could not open file. we have not verified the MergeFileListFast, but that should work properly because the file is successfully created. Let me know if you need also to check what it returns to Merge Thanks Daniele |
|
sangeeth
Beginner Joined: 03 Mar 12 Location: EKM Status: Offline Points: 7 |
Post Options
Thanks(0)
|
Hi Daniele,
The issue is with function LoadFromFile() it fails when the number of pages exceeds 7, I have checked it and found that upto page 7 the LoadFromfile() works fine and also the encryption works, but if I tried to load a pdf with 8 or more pages it fails and gives the error code 401. Any one please help me to fix the issue. Thanks, Sangeeth
|
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
Hi Sangeeth!
Don't tell such nonsense ... I've told you already what you can do: http://www.quickpdf.org/forum/encrypt-function-fails-when-page-no-excceds-7_topic2178.html Your idea with more than 7 pages is completely b... ;-) Cheers, Ingo |
|
sangeeth
Beginner Joined: 03 Mar 12 Location: EKM Status: Offline Points: 7 |
Post Options
Thanks(0)
|
Hi Ingo,
Sorry for the above post. This issue occurs only for some types of pdf files. In my few reports it failed to Load the file if it exceeds 7 pages. I have tested it with few sample files and I will continue the post regarding this. Thanks, Sangeeth
|
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
Hi Sangeeth! What could be is:
If the loaded files are encrypted your new encryption won't work.
First you have to check if the files are encrypted and if "yes" you
have to decrypt them and then you can create a new encryption.
You understand? ...you can't create a new encryption on a file
where's already an encryption with a main password ;-)
This could be a possible reason for your probs.
Cheers, Ingo
|
|
sangeeth
Beginner Joined: 03 Mar 12 Location: EKM Status: Offline Points: 7 |
Post Options
Thanks(0)
|
Hi Ingo,
Thank you for the response. I will continue the reply in http://www.quickpdf.org/forum/encrypt-function-fails-when-page-no-excceds-7_topic2178.html. Thanks, Sangeeth.
|
|
Cuspide
Team Player Joined: 25 May 10 Status: Offline Points: 21 |
Post Options
Thanks(0)
|
Hi Andrew I have not had a reply to this post Thanks Daniele
|
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
Hi Daniele!
Why should he answer ... perhaps he doesn't have enough freetime to do it?
Please keep in mind that this here is a user-user-forum and not a publisher-
user-forum ;-)
So you have to wait for an answer or try by yourself and if you have a solution
you should post it here for other users ;-)
Or you can try the official support pages if you're a customer...
Cheers, Ingo
|
|
Cuspide
Team Player Joined: 25 May 10 Status: Offline Points: 21 |
Post Options
Thanks(0)
|
Hi Ingo, I wrote the message again as it was to wonder what Andrew and I returned the MergeFileListFast promptly responded as of the anomaly. However, I have not received an answer ... if someone asks me a question because it has in mind a possible solution, otherwise it would pose the question. Could you kindly tell me the official support page? Thanks Daniele
|
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
Hi Daniele!
I'm wondering, i'm wondering ... How long are you on the net? "QuickPDF Library" with Google and the official pages are on the first position ;-) This is the official product page: http://www.quickpdflibrary.com/ Common support: http://www.quickpdflibrary.com/support/index.php Technical support: http://www.quickpdflibrary.com/support/support-query.php Cheers, Ingo |
|
Cuspide
Team Player Joined: 25 May 10 Status: Offline Points: 21 |
Post Options
Thanks(0)
|
Thank you very much ;-)
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. About — Contact — Blog — Support — Online Store