update tab title  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
User avatar
MartinCS
User
Posts: 153
Joined: Thu Apr 07, 2011 10:01 am
Contact:

update tab title

Post by MartinCS »

Hi Tracker Team,

is it possible to update the tab title of an opened pdf document with custom text information?
28-10-_2016_11-01-23.zip
(8.93 KiB) Downloaded 104 times
Thank you for your help!


Cheers,
Martin
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: update tab title

Post by Sasha - Tracker Dev Team »

Hello Martin,

Well, you can update the Document Title in the Document Properties\Document Info. If that's what you want (please try doing that in the End-User Editor) I can give you a code sample.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
User avatar
MartinCS
User
Posts: 153
Joined: Thu Apr 07, 2011 10:01 am
Contact:

Re: update tab title

Post by MartinCS »

Hi,

thank you for the quick reply Alex. Could you post me the code snippet you mentioned? That would be awesome.

I'm using the following code to open a pdf document:

Code: Select all

pdfCtl.OpenDocFromPath(filePath);
Afterwards I would like to change the tab title information.


Thank you,
Martin
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: update tab title

Post by Sasha - Tracker Dev Team »

Here's the operation that you need (the wiki page includes a sample required):
https://sdkhelp.pdf-xchange.com/vie ... changeInfo

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
User avatar
MartinCS
User
Posts: 153
Joined: Thu Apr 07, 2011 10:01 am
Contact:

Re: update tab title

Post by MartinCS »

Thanks alot for your quick help, Alex!
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: update tab title

Post by Sasha - Tracker Dev Team »

:)
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
User avatar
MartinCS
User
Posts: 153
Joined: Thu Apr 07, 2011 10:01 am
Contact:

Re: update tab title

Post by MartinCS »

Hi Alex,

I implemented the sample code you supplied and it is changing the title of the pdf document. But the update of the document property is not reflecting in the Editor UI (see screen shot). Am I missing something or misunderstood your first post?
28-10-_2016_12-51-30.zip
(53.88 KiB) Downloaded 108 times
Martin
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: update tab title

Post by Sasha - Tracker Dev Team »

You will also need to set this option for the document:
http://imgur.com/a/oqGFV
To do that you will need to specify the PXC_DocumentViewFlags.DocViewFlag_DisplayDocTitle in the "ViewFlags" CAB item.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
User avatar
MartinCS
User
Posts: 153
Joined: Thu Apr 07, 2011 10:01 am
Contact:

Re: update tab title

Post by MartinCS »

Alex,

how do I get the cab item ViewFlags? I have no idea how to access it.

Could you assist me with a short code snippet, please?


Cheers,
Martin
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: update tab title

Post by Sasha - Tracker Dev Team »

Code: Select all

options["ViewFlags"].v = PXC_DocumentViewFlags.DocViewFlag_DisplayDocTitle;
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
User avatar
MartinCS
User
Posts: 153
Joined: Thu Apr 07, 2011 10:01 am
Contact:

Re: update tab title

Post by MartinCS »

Hi Alex,

unfortunately I'm not able to update the viewsflag. I'm running the following code:

Code: Select all

var nId = pdfCtl.Inst.Str2ID("op.document.changeInfo", false);
var pOp = pdfCtl.Inst.CreateOp(nId);

ICabNode options = pOp.Params.Root["Options"];
options["ViewFlags"].v = PXC_DocumentViewFlags.DocViewFlag_DisplayDocTitle;

pOp.Do();
Is this the right way. I guess I'm setting the wrong string id for the operation.


Cheers,
Martin
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: update tab title  SOLVED

Post by Sasha - Tracker Dev Team »

Please check the wiki page again - I've updated the sample. It seems that the ViewFlags should be set by using a 1 << method - will add that to documentation. And also, the CDPF_ViewFlags mask should be added.
https://sdkhelp.pdf-xchange.com/vie ... nfo#Sample

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
User avatar
MartinCS
User
Posts: 153
Joined: Thu Apr 07, 2011 10:01 am
Contact:

Re: update tab title

Post by MartinCS »

Alex,

it's working now. :D

Thank you again for your very quick help and the addition of the code snippet in the documentation.


Cheers,
Martin
Last edited by MartinCS on Fri Oct 28, 2016 2:43 pm, edited 1 time in total.
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: update tab title

Post by Sasha - Tracker Dev Team »

Glad that helped :wink:
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Post Reply