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 - LoadFromFile fails after doing a MergeFileListFast
  FAQ FAQ  Forum Search   Register Register  Login Login

LoadFromFile fails after doing a MergeFileListFast

 Post Reply Post Reply
Author
Message
jhuang View Drop Down
Beginner
Beginner


Joined: 28 Jul 06
Location: United States
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote jhuang Quote  Post ReplyReply Direct Link To This Post Topic: LoadFromFile fails after doing a MergeFileListFast
    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.
 
Back to Top
AndrewC View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 08 Dec 10
Location: Geelong, Aust
Status: Offline
Points: 841
Post Options Post Options   Thanks (0) Thanks(0)   Quote AndrewC Quote  Post ReplyReply Direct Link To This Post Posted: 10 Aug 11 at 12:39PM
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.
Back to Top
jhuang View Drop Down
Beginner
Beginner


Joined: 28 Jul 06
Location: United States
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote jhuang Quote  Post ReplyReply Direct Link To This Post Posted: 10 Aug 11 at 4:59PM
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.
Back to Top
AndrewC View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 08 Dec 10
Location: Geelong, Aust
Status: Offline
Points: 841
Post Options Post Options   Thanks (0) Thanks(0)   Quote AndrewC Quote  Post ReplyReply Direct Link To This Post Posted: 12 Aug 11 at 3:23PM
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
Back to Top
jhuang View Drop Down
Beginner
Beginner


Joined: 28 Jul 06
Location: United States
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote jhuang Quote  Post ReplyReply Direct Link To This Post Posted: 13 Aug 11 at 12:25AM

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.
Back to Top
Cuspide View Drop Down
Team Player
Team Player


Joined: 25 May 10
Status: Offline
Points: 21
Post Options Post Options   Thanks (0) Thanks(0)   Quote Cuspide Quote  Post ReplyReply Direct Link To This Post Posted: 24 Feb 12 at 10:33AM
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
Back to Top
Cuspide View Drop Down
Team Player
Team Player


Joined: 25 May 10
Status: Offline
Points: 21
Post Options Post Options   Thanks (0) Thanks(0)   Quote Cuspide Quote  Post ReplyReply Direct Link To This Post Posted: 28 Feb 12 at 9:04AM
Can anyone help me?
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 28 Feb 12 at 9:18AM
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
Back to Top
Cuspide View Drop Down
Team Player
Team Player


Joined: 25 May 10
Status: Offline
Points: 21
Post Options Post Options   Thanks (0) Thanks(0)   Quote Cuspide Quote  Post ReplyReply Direct Link To This Post Posted: 28 Feb 12 at 10:02AM
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
Back to Top
AndrewC View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 08 Dec 10
Location: Geelong, Aust
Status: Offline
Points: 841
Post Options Post Options   Thanks (0) Thanks(0)   Quote AndrewC Quote  Post ReplyReply Direct Link To This Post Posted: 29 Feb 12 at 8:34AM
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().


Back to Top
Cuspide View Drop Down
Team Player
Team Player


Joined: 25 May 10
Status: Offline
Points: 21
Post Options Post Options   Thanks (0) Thanks(0)   Quote Cuspide Quote  Post ReplyReply Direct Link To This Post Posted: 29 Feb 12 at 11:02AM
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

Back to Top
sangeeth View Drop Down
Beginner
Beginner
Avatar

Joined: 03 Mar 12
Location: EKM
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote sangeeth Quote  Post ReplyReply Direct Link To This Post Posted: 03 Mar 12 at 7:08AM
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
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 03 Mar 12 at 10:21AM
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
Back to Top
sangeeth View Drop Down
Beginner
Beginner
Avatar

Joined: 03 Mar 12
Location: EKM
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote sangeeth Quote  Post ReplyReply Direct Link To This Post Posted: 05 Mar 12 at 5:21AM
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
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 05 Mar 12 at 11:14AM

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
Back to Top
sangeeth View Drop Down
Beginner
Beginner
Avatar

Joined: 03 Mar 12
Location: EKM
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote sangeeth Quote  Post ReplyReply Direct Link To This Post Posted: 05 Mar 12 at 11:35AM
Hi Ingo,
 
Thank you for the response.
 
 
Thanks,
Sangeeth.
Back to Top
Cuspide View Drop Down
Team Player
Team Player


Joined: 25 May 10
Status: Offline
Points: 21
Post Options Post Options   Thanks (0) Thanks(0)   Quote Cuspide Quote  Post ReplyReply Direct Link To This Post Posted: 07 Mar 12 at 1:39PM
Hi Andrew
I have not had a reply to this post

Thanks
Daniele

Originally posted by Cuspide Cuspide wrote:

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

Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 07 Mar 12 at 11:25PM
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
 
Back to Top
Cuspide View Drop Down
Team Player
Team Player


Joined: 25 May 10
Status: Offline
Points: 21
Post Options Post Options   Thanks (0) Thanks(0)   Quote Cuspide Quote  Post ReplyReply Direct Link To This Post Posted: 09 Mar 12 at 1:25PM
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
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 09 Mar 12 at 5:24PM
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

Back to Top
Cuspide View Drop Down
Team Player
Team Player


Joined: 25 May 10
Status: Offline
Points: 21
Post Options Post Options   Thanks (0) Thanks(0)   Quote Cuspide Quote  Post ReplyReply Direct Link To This Post Posted: 12 Mar 12 at 11:48AM
Thank you very much ;-)
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