Saving document using cmd.save command for IStream opened documents

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

Saving document using cmd.save command for IStream opened documents

Post by zarkogajic »

Hi support,

I'm opening documents using MainFrame's OpenDocFrom and passing in an IStream. The IStream is "generated" from CreateFileW with GENERIC_READ | GENERIC_WRITE | FILE_SHARE_READ | FILE_SHARE_WRITE.

After some edits to the document, if I close the document via CloseTab or File-Close (main menu) - after the "do you want to save changes" - the document is saved and closed without any issues.

If I execute "cmd.save" (so to save but not to close the document), the document will be saved but I would receive:

image.png

The same happens in FullDemo.

Is it possible to save a document opened via IStream and keep it open?


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

Re: Saving document using cmd.save command for IStream opened documents

Post by Sasha - Tracker Dev Team »

Hello žarko,

Why do you need to do a double conversion here? If you have a file, you can open it directly by path.
Also, saving to IStream only depends on the Wrapper that you have used - if there is an implementation of such a possibility then it we support it.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
zarkogajic
User
Posts: 1370
Joined: Thu Sep 05, 2019 12:35 pm

Re: Saving document using cmd.save command for IStream opened documents

Post by zarkogajic »

Hi Alex,
Why do you need to do a double conversion here? If you have a file, you can open it directly by path.
Ah, that's a long and sad story :)

As per some of my previous posts, specifically this one: viewtopic.php?f=66&t=33398&p=138267&hil ... ew#p137980

I'm using multiple pxvControls in my application. Many act as a Viewer one as an Editor. I need to have instances of pxVControl to work separately. So far, I've successfully (hope so) been able to force pxvControl instances to work/act as standalone.

The only problem I was not able to solve is the searchView functionality. If a document is open in FrameA and search "in folder" is initiated in FrameB, clicking on the search result of a document opened in FrameA will activate that document - while I need this not to work in that way (since all actions must happen in FrameB - where search is initiated).

By trial/error I've figured that if I open a document via IStream your internal code will not be able to find documents in other Frames - since the "CoreDoc.SrcInfo.ActualFileName" is empty - and I guess this is how you look for documents when deciding if a document is already open in some frame (?).

So, the only reason I'm using IStream is to "hide" a document from your internal "find document" implementation.

If you recall, this is the feature I've been asking for .. some event to react on when your internal code decides if a document is already open or should be open in a Frame.

The above applies as well for the hightlighter (also explained in the mentioned thread).
Also, saving to IStream only depends on the Wrapper that you have used - if there is an implementation of such a possibility then it we support it.
Saving of the file opened via IStream works (that's if GENERIC_WRITE is specified, which I do not like and will need to find a different approach) - what happens after the save troubles me ("document unavailable").



-žarko
zarkogajic
User
Posts: 1370
Joined: Thu Sep 05, 2019 12:35 pm

Re: Saving document using cmd.save command for IStream opened documents

Post by zarkogajic »

Hi support,

Any new info here?

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

Re: Saving document using cmd.save command for IStream opened documents

Post by Sasha - Tracker Dev Team »

Hello žarko,

Well I've tried recreating this and this dialog appears:
image.png
Then if I Close it, then the one that you have mentioned shows up.
Do you see the first dialog that I mentioned?

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
zarkogajic
User
Posts: 1370
Joined: Thu Sep 05, 2019 12:35 pm

Re: Saving document using cmd.save command for IStream opened documents

Post by zarkogajic »

Hi Alex,

Nope.

Here's what I'm doing:

image.png

So: open a file as IStream, do some changes, close the tab.

image.png
image.png (30.8 KiB) Viewed 1358 times

Click "yes" here:

image.png

And the file gets properly saved (and closed, though).


I need to be able to do the same - save it with "cmd.save" (or any other means) - but without closing it.


-žarko
zarkogajic
User
Posts: 1370
Joined: Thu Sep 05, 2019 12:35 pm

Re: Saving document using cmd.save command for IStream opened documents

Post by zarkogajic »

Any ideas here?

Post Reply