Open read only and tab title

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
edvschu
User
Posts: 127
Joined: Fri Jun 25, 2010 6:54 am

Open read only and tab title

Post by edvschu »

Hello,

i open a PDF with:

Code: Select all

m_pdfCtl.OpenDocFromPath(DocumentFileName, oReadOnlyParams)
Change tab title can do with:

Code: Select all

pdfCtl.Doc.CoreDoc.Props.ViewPrefFlag(PDFXEdit.PXC_DocumentViewFlags.DocViewFlag_DisplayDocTitle) = True
pdfCtl.Doc.CoreDoc.SrcInfo.CustDispTitle = sTitle
Dim evtID = pdfCtl.Inst.Str2ID("e.document.propsChanged", False)
Dim unkPtr As IntPtr = System.Runtime.InteropServices.Marshal.GetIUnknownForObject(pdfCtl.Doc)
Dim evt As PDFXEdit.IEvent = pdfCtl.Doc.EventServer.CreateNewEvent(evtID, CUInt(unkPtr), CUInt(PDFXEdit.PXC_DocumentViewFlags.DocViewFlag_DisplayDocTitle))
pdfCtl.Doc.EventServer.FireEvent(evt, pdfCtl.Doc)
But open as read only let not change tab title. Is there another way to solve this?

Best Regards,
edvschu
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Open read only and tab title

Post by Sasha - Tracker Dev Team »

Hello edvschu,

Well, you are opening a document as ReadOnly - how it should be possible to change something then?

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
edvschu
User
Posts: 127
Joined: Fri Jun 25, 2010 6:54 am

Re: Open read only and tab title

Post by edvschu »

I already know that this does not match. But in old Viewer SDK it was possible.

The background is that no changes to the PDF are allowed. At the same time,
however, a different name should be displayed in the tab.
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Open read only and tab title

Post by Sasha - Tracker Dev Team »

Try changing the IUIX_LayoutItem::Title like you are changing the Tooltip.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
edvschu
User
Posts: 127
Joined: Fri Jun 25, 2010 6:54 am

Re: Open read only and tab title

Post by edvschu »

Is working. Thanks for the hint.
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Open read only and tab title

Post by Sasha - Tracker Dev Team »

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