Why is the operation so slow?

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.
HomerWu
User
Posts: 91
Joined: Fri Nov 25, 2016 8:19 am

Why is the operation so slow?

Post by HomerWu »

hello,

I created a preciew control to preview the watermark and header&footer,after user changed the value,then update the doc,and my logic is as below:

1.remove old watemark
2.remove old header&footer (yes,user can change both the watermark para and header&footer para in the same form)
3.add header&footer
4.add watermark
5.invalidatepage

i found remove watermark/header&footer and add watermark/header&footer cost almost a minute(my document has only 58 pages).
do you have any suggestion to help me?
the attachmens are part of log file and our preview form.
You do not have the required permissions to view the files attached to this post.
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am

Re: Why is the operation so slow?

Post by Sasha - Tracker Dev Team »

Hello HomerWu,

Well that's because you are doing it like that. Why can't you remove all of the watermarks/HaFs in one go and then add the needed watermarks and HaFs in another go - should be a couple of seconds.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
HomerWu
User
Posts: 91
Joined: Fri Nov 25, 2016 8:19 am

Re: Why is the operation so slow?

Post by HomerWu »

Hello Sasha,

So how can i remove all of the watermarks/HaFs in one go and add the needed watermarks and HaFs in another go?i 'm now using the operations op.document.removeHeaderAndFooter、 op.document.removeWatermarks
、op.document.addHeaderAndFooter、 op.document.addWatermarks one by one :roll:
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am

Re: Why is the operation so slow?

Post by Sasha - Tracker Dev Team »

Hello HomerWu,

Just remove them from all of the pages and add them to all of the pages - that's all.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ