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 - CopyPageRanges very slowly!
  FAQ FAQ  Forum Search   Register Register  Login Login

CopyPageRanges very slowly!

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


Joined: 10 Feb 12
Location: Belarus,Minsk
Status: Offline
Points: 13
Post Options Post Options   Thanks (0) Thanks(0)   Quote AlexCasual Quote  Post ReplyReply Direct Link To This Post Topic: CopyPageRanges very slowly!
    Posted: 14 Feb 12 at 8:12AM
I want to create multipage pdf with function LoadFromString()...And if I use CopyPageRanges() from document created by  LoadFromString() to my multipage document it's VERY slowly!
Please help!
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: 14 Feb 12 at 9:37AM
Hi Alex!
 
This could depend on the type of your pdfs (where's a sample?).
Perhaps it have to do with your code (where's a sample?).
You should deliver more infos if you need help.
And don't forget: It's a user-user-forum here - not the official support pages ;-)
 
Cheers, Ingo


Edited by Ingo - 14 Feb 12 at 9:37AM
Back to Top
AlexCasual View Drop Down
Beginner
Beginner


Joined: 10 Feb 12
Location: Belarus,Minsk
Status: Offline
Points: 13
Post Options Post Options   Thanks (0) Thanks(0)   Quote AlexCasual Quote  Post ReplyReply Direct Link To This Post Posted: 14 Feb 12 at 2:53PM
Part of C++ code :

..........
int pdf_id = m_QP->NewDocument();

for (SIZE_T i = 0; i < this->count_; ++i)
{
   m_QP->SetOrigin(1);

   std::string pdf_source;
   this->GetDataPdf(i,pdf_source); // <- Read pdf files from disk

   load_result = m_QP->LoadFromString(pdf_source,L"");
   
   int curr_id = m_QP->SelectedDocument();

   m_QP->SelectDocument(pdf_id);

   m_QP->CopyPageRanges(curr_id,L"1"); // <- VERY SLOWLY!!!

   m_QP->RemoveDocument(curr_id);
}
std::string pdf_source;
try
{
    m_QP->DeletePages(1,1);

    pdf_source = m_QP->SaveToString();

   m_QP->SaveToFile(L"c:\\Z.pdf");

   m_QP->RemoveDocument(pdf_id);
}
catch(...){}
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: 15 Feb 12 at 7:20PM
Hi!

At other parts you can save time.
First you load into string and then the string into QP.
At least you save to string and then from string via QP to file.
Why?
In your case i would remove the load/save to string?
If you want to copy pages from one document to the other
and want to delete them later in the original document
you should better use the capture functions (so one step less ;-).
To save further performance you can use the DA-functionalities.

Cheers, Ingo


Edited by Ingo - 15 Feb 12 at 7:27PM
Back to Top
AlexCasual View Drop Down
Beginner
Beginner


Joined: 10 Feb 12
Location: Belarus,Minsk
Status: Offline
Points: 13
Post Options Post Options   Thanks (0) Thanks(0)   Quote AlexCasual Quote  Post ReplyReply Direct Link To This Post Posted: 16 Feb 12 at 6:56PM
Capture functions will be working better?
Back to Top
AlexCasual View Drop Down
Beginner
Beginner


Joined: 10 Feb 12
Location: Belarus,Minsk
Status: Offline
Points: 13
Post Options Post Options   Thanks (0) Thanks(0)   Quote AlexCasual Quote  Post ReplyReply Direct Link To This Post Posted: 16 Feb 12 at 7:06PM
But I need copy pages from one document to another,can I use capture functions in this case?  
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: 16 Feb 12 at 7:50PM
I've seen copy and then delete - so i thought it was better to capture ;-)
Back to Top
edvoigt View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 Mar 11
Location: Berlin, Germany
Status: Offline
Points: 111
Post Options Post Options   Thanks (0) Thanks(0)   Quote edvoigt Quote  Post ReplyReply Direct Link To This Post Posted: 16 Feb 12 at 9:16PM
Hi,

working with capture is only possible in one document, so you need merge in any form before.

As Ingo said, explain please more accurate what you want. I assume you want to build a new PDF and your source is another (bigger) PDF from which you need only a few pages?

Remember about the difference between your PDF on disk and the document in QP, which is a construct in memory. First you should use the "normal" way loadfromfile without going a way over a string. This string needs memory, QP->document needs memory. So you help QP to be slow.

If you have one PDF from which you need some pages, so the easiest way is to take it and delte the unneeded pages. So you have only one document in memory. After deleting process it is to save and you are ready.

If the PDF is very big, it may be better to use DA..., but try first easy

QP.Loadfromfile('name.pdf', '');
QP.DeletePage(12, 6); // example: without 12,13,..17
QP.SaveToFile('name_new.pdf');

 
to get a feeling for the possibilities of QP. More as this kernel operations is not needed.

Werner

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