op.combineDocs + AddRootBookmarks + some info on internals  SOLVED

PDF-XChange Editor SDK for Developers

Moderators: TrackerSupp-Daniel, Tracker Support, Chris - Tracker Supp, Vasyl-Tracker Dev Team, Sean - Tracker, Paul - Tracker Supp, Tracker Supp-Stefan, Ivan - Tracker Software

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
zarkogajic
User
Posts: 933
Joined: Thu Sep 05, 2019 12:35 pm

op.combineDocs + AddRootBookmarks + some info on internals

Post by zarkogajic » Wed Feb 24, 2021 10:35 am

Hi Support,

When using op.combineDocs with AddRootBookmarks -> what would be the best way to change the generated bookmark's title from the file name to something else (example: PDF Title from PDF Properties, or custom value in general)?

Also, can you share some internals on what IPXC methods are used by this operation - if I want to do what the operation does but without the operation :) To make it simple I would need to combine a few documents (all pages), have bookmarks copied over (and their goto actions "fixed" to point to proper page, etc) - all programmatically using IPXC various methods ?

-žarko

zarkogajic
User
Posts: 933
Joined: Thu Sep 05, 2019 12:35 pm

Re: op.combineDocs + AddRootBookmarks + some info on internals

Post by zarkogajic » Wed Feb 24, 2021 4:26 pm

Hi Support,

For this part:
When using op.combineDocs with AddRootBookmarks -> what would be the best way to change the generated bookmark's title from the file name to something else (example: PDF Title from PDF Properties, or custom value in general)?
It seems I'm actually asking for a "feature request": to add something like "RootBookmarkTitle" to the op.combineDoc's IOpInputItem :)

For the moment, it only contains "PagesRange", so adding "BookmarkTitle" would/could allow to set a specific bookmark title when "AddRootBookmarks" is used.

p.s.
Pretty please ;)


-žarko

User avatar
Dimitar - Tracker Supp
Site Admin
Posts: 930
Joined: Mon Jan 15, 2018 9:01 am

Re: op.combineDocs + AddRootBookmarks + some info on internals

Post by Dimitar - Tracker Supp » Fri Feb 26, 2021 7:08 am

Hello žarko,

Thank you for using our product.

A feature request ticket was created in our internal ticket system. Let's hope that your wishes will be fulfilled soon :-)


#5504: FR: op.combineDocs + AddRootBookmarks + some info on internals


When asking about developments in this regard, please also mention the ticket number.


Regards.

zarkogajic
User
Posts: 933
Joined: Thu Sep 05, 2019 12:35 pm

Re: op.combineDocs + AddRootBookmarks + some info on internals

Post by zarkogajic » Fri Feb 26, 2021 8:40 am

Hi Dimitar,

Thanks! This small feature request will then allow to do oh so much more :)

Here's what I'm really up to (and will be able to do once I can specify root-per-document bookmark titles):

Say I'm combining documents:

pdf1 (1 page) + pdf2 (2 pages) + pdf3 (3 pages)

The resulting combined.pdf will have 6 pages.

I need to inject an additional "title" page (and maybe some more) inside the combined.pdf, so it looks like (9 total pages):

pdf1_title_page
pdf1_page1
pdf2_title_page
pdf2_page1
pdf2_page2
pdf3_title_page
pdf3_page1
pdf3_page2
pdf3_page3

While it might seem this is also possible now - so just add more CoreDocs (doc title page) to the Op's Input Param - that's really not the way to go.

As, for example, if pdf2 has such security settings that it will deny page extraction, the "Cannot add file / operation not permitted for document" dialog will popup and the user can decide to Ignore (or Abort). If "ignore" is selected, pdf2 will not be a part of combined.pdf - and therefore "pdf2_title_page" must also be ignored.

For the moment, there's no way to catch "Ignore" for a particular document as there's no callback (I know of ...?) while the Op is running to get notified if some documents cannot be combined. Relying on filename bookmark titles (how it is now) is also not possible as one might combine documents having the same file name (different folder).

Now, having custom bookmark titles, here's what I will be able to do:

1. Have a dictionary with unique (per document) Guid values set for each document's root bookmark title.
2. Once the operation is done:
2.1. Scan root bookmark titles for a Guid, read resulting bookmark's GoTo action to get the page it points to
2.2. Insert additional page(s) before that page
2.3. Change the bookmark's title to the real needed value

And then only the imagination is the limit :)

-žarko

User avatar
Sasha - Tracker Dev Team
User
Posts: 5388
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: op.combineDocs + AddRootBookmarks + some info on internals

Post by Sasha - Tracker Dev Team » Mon Mar 01, 2021 3:50 pm

Hello zarkogajic,

Done - the RootBookmarkTitle has been added to the input item dictionary. This will be available from the next 353 release.

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

zarkogajic
User
Posts: 933
Joined: Thu Sep 05, 2019 12:35 pm

Re: op.combineDocs + AddRootBookmarks + some info on internals

Post by zarkogajic » Mon Mar 01, 2021 4:33 pm

Hi Alex,

Thanks.

The 353 is the most anticipated release for the moment ;)


User avatar
Sasha - Tracker Dev Team
User
Posts: 5388
Joined: Fri Nov 21, 2014 8:27 am
Contact:

op.combineDocs + AddRootBookmarks + some info on internals  SOLVED

Post by Sasha - Tracker Dev Team » Mon Mar 01, 2021 7:15 pm

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

Post Reply