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!
CopyPageRanges very slowly! |
Post Reply |
Author | |
AlexCasual
Beginner Joined: 10 Feb 12 Location: Belarus,Minsk Status: Offline Points: 13 |
Post Options
Thanks(0)
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!
|
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
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 |
|
AlexCasual
Beginner Joined: 10 Feb 12 Location: Belarus,Minsk Status: Offline Points: 13 |
Post Options
Thanks(0)
|
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_ load_result = m_QP->LoadFromString(pdf_ int curr_id = m_QP->SelectedDocument(); m_QP->SelectDocument(pdf_id); m_QP->CopyPageRanges(curr_id, 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(...){} |
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
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 |
|
AlexCasual
Beginner Joined: 10 Feb 12 Location: Belarus,Minsk Status: Offline Points: 13 |
Post Options
Thanks(0)
|
Capture functions will be working better?
|
|
AlexCasual
Beginner Joined: 10 Feb 12 Location: Belarus,Minsk Status: Offline Points: 13 |
Post Options
Thanks(0)
|
But I need copy pages from one document to another,can I use capture functions in this case?
|
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
I've seen copy and then delete - so i thought it was better to capture ;-)
|
|
edvoigt
Senior Member Joined: 26 Mar 11 Location: Berlin, Germany Status: Offline Points: 111 |
Post Options
Thanks(0)
|
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 |
|
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