How to improve ExtractPages/ReplacePages speed`?  SOLVED

PDF-XChange Editor SDK for Developers

Moderators: TrackerSupp-Daniel, Tracker Support, Paul - Tracker Supp, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, 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
Woodgnome
User
Posts: 27
Joined: Tue Oct 10, 2017 11:25 am

How to improve ExtractPages/ReplacePages speed`?

Post by Woodgnome »

A customer contacted our support claiming that the our PDF viewer (using the Editor SDK) is freezing unexpectedly - after some debugging it turns out it's just working on extracting/replacing pages and it takes a long time.

I was able to reproduce this behaviour in the sample full demo (using the latest SDK version):

https://youtu.be/NwX52u8htcs

Especially the replace pages operation speed (10 seconds) seems a bit absurd - is there a way you/I can speed up these operations?

PDF in question: https://drive.google.com/open?id=1Fdc1E ... sp9XxkqgLN
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: How to improve ExtractPages/ReplacePages speed`?

Post by Sasha - Tracker Dev Team »

Hello Woodgnome,

Are you using Debug or Release version of the FullDemo application (the processing time can drastically differ)?
Can that behavior be recreated in the End-User Editor?

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Woodgnome
User
Posts: 27
Joined: Tue Oct 10, 2017 11:25 am

Re: How to improve ExtractPages/ReplacePages speed`?

Post by Woodgnome »

Sasha - Tracker Dev Team wrote: Fri Jan 17, 2020 12:39 pm Are you using Debug or Release version of the FullDemo application (the processing time can drastically differ)?
Can that behavior be recreated in the End-User Editor?
Release version and yes: https://youtu.be/phavV92jZVc

It may be worth pointing out that there is a large amount of layers in the PDF (added by our application) - not sure if that affects processing time.
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: How to improve ExtractPages/ReplacePages speed`?  SOLVED

Post by Sasha - Tracker Dev Team »

Hello Woodgnome,

The layers are not a problem. We've analyzed the document itself (Save As Optimized/Audit) - the majority of the document are the images inside of it - near 74%. And also, the document itself is not that small - 50mb for 67 pages. Thus you will have to wait for some time so that all of that images are placed back into the original document.
When optimized with the default settings - the document becomes smaller - near 20mb and also, all of the operations that you were doing became almost instant.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Woodgnome
User
Posts: 27
Joined: Tue Oct 10, 2017 11:25 am

Re: How to improve ExtractPages/ReplacePages speed`?

Post by Woodgnome »

Alright, I assume the corresponding SDK operation to optimize a document is this one: https://sdkhelp.pdf-xchange.com/vi ... t_optimize, yes?
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: How to improve ExtractPages/ReplacePages speed`?

Post by Sasha - Tracker Dev Team »

Hello Woodgnome,

Yes that's the one. But note that the optimization lowers the quality of the images - so you need to be careful with the parameters.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Woodgnome
User
Posts: 27
Joined: Tue Oct 10, 2017 11:25 am

Re: How to improve ExtractPages/ReplacePages speed`?

Post by Woodgnome »

Got it 👌
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: How to improve ExtractPages/ReplacePages speed`?

Post by Sasha - Tracker Dev Team »

:)
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Post Reply