Default SaveTo Folder for cmd.saveAs / cmd.saveCopyAs -> 'Docs.Save.SaveAsFolderType' ignored for IStream open documents  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
zarkogajic
User
Posts: 1370
Joined: Thu Sep 05, 2019 12:35 pm

Default SaveTo Folder for cmd.saveAs / cmd.saveCopyAs -> 'Docs.Save.SaveAsFolderType' ignored for IStream open documents

Post by zarkogajic »

Hi Support,

I'm executing the cmd.saveAs / cmd.saveCopyAs via Inst.ExecUICmd.

I'm trying to specify the default save to folder via:

Inst.Settings['Docs.Save.SaveAsFolderType'].v := 2
Inst.Settings['Docs.Save.CustomSaveAsFolder'].v := *folder*
Inst.FireAppPrefsChanged(PXV_AppPrefsChange_Documents)
Inst.ExecUICmd('cmd.saveCopyAs')

When the Save As dialog appears - the initial directory is always set to "last used folder".

I've also tried Inst.Settings['Docs.Save.SaveAsFolderType'].v := 1 //original document folder -> but again the last used folder is used.

In EU Editor (9.352) this seems to work correctly.

-žarko
Last edited by zarkogajic on Fri Mar 05, 2021 9:03 am, edited 1 time in total.
zarkogajic
User
Posts: 1370
Joined: Thu Sep 05, 2019 12:35 pm

Re: Default SaveTo Folder for cmd.saveAs / cmd.saveCopyAs -> 'Docs.Save.SaveAsFolderType' ignored

Post by zarkogajic »

Hi Support,

More info: this only happens when a document is open via IStream!

Can be re-created in FullDemo.

Have "ckIStreamSrcDemo" checked and open two documents from two different locations (use multi document mode).

Then, try for each document:

Code: Select all

pdfCtl.Inst.Settings["Docs.Save.SaveAsFolderType"].v = 1;
//OR
pdfCtl.Inst.Settings["Docs.Save.SaveAsFolderType"].v = 2;
pdfCtl.Inst.Settings["Docs.Save.CustomSaveAsFolder"].v = @"C:\Users\Public\Documents" ;

pdfCtl.Inst.FireAppPrefsChanged(PDFXEdit.PXV_AppPrefsChanges.PXV_AppPrefsChange_Documents);

pdfCtl.Inst.ExecUICmd("cmd.saveCopyAs");
The initial folder for SaveAs dialog is always "last used" - and not what was set above.

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

Re: Default SaveTo Folder for cmd.saveAs / cmd.saveCopyAs -> 'Docs.Save.SaveAsFolderType' ignored for IStream open docum

Post by zarkogajic »

HI Support,

Also ignored for non-pdf documents opened in PXV_Control (converted to PDF).

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

Re: Default SaveTo Folder for cmd.saveAs / cmd.saveCopyAs -> 'Docs.Save.SaveAsFolderType' ignored for IStream open docum

Post by Sasha - Tracker Dev Team »

Hello zarkogajic,

Well the IStream source does behave differently - forwarded this for detailed investigation.

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

Re: Default SaveTo Folder for cmd.saveAs / cmd.saveCopyAs -> 'Docs.Save.SaveAsFolderType' ignored for IStream open docum

Post by zarkogajic »

Hi Alex,

Thanks. Until this is fixed, I'm now custom handling the cmd.saveCopyAs via IUIX_CmdHandler.

Using Inst.ShowSaveFileDlg(pInitialFolderName, ...) + IPXV_Document.Save (.., DefautProgressMon, ..) .. and I can save, at least as ordinary PDF...

There are various PXV_DocSaveFlags I can use for nFlags in Save().

Can you provide more info on PXV_DocSave_Copy, PXV_DocSave_SwitchToDest and PXV_DocSave_Sync ?

The rest of values - I (kind of) figured out ...

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

Re: Default SaveTo Folder for cmd.saveAs / cmd.saveCopyAs -> 'Docs.Save.SaveAsFolderType' ignored for IStream open docum

Post by Sasha - Tracker Dev Team »

Hello zarkogajic,

Well I passed these IStream problems to Vasyl - waiting for the reply.

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

Re: Default SaveTo Folder for cmd.saveAs / cmd.saveCopyAs -> 'Docs.Save.SaveAsFolderType' ignored for IStream open docum

Post by zarkogajic »

Hi Alex,

OK, thanks.

While wating please answer:
Can you provide more info on PXV_DocSave_Copy, PXV_DocSave_SwitchToDest and PXV_DocSave_Sync ?
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Default SaveTo Folder for cmd.saveAs / cmd.saveCopyAs -> 'Docs.Save.SaveAsFolderType' ignored for IStream open docum

Post by Sasha - Tracker Dev Team »

Hello zarkogajic,

Here's what I can get from code comments:

Code: Select all

	PXV_DocSave_Copy					= 0x0002,	// to enable "Save As"/"Save as Copy" modes, 
													// used when pDest == NULL and PXV_DocSave_AllowUI is specified to ask user by "Save As"/"Save as Copy" dialogue

	PXV_DocSave_SwitchToDest			= 0x0004,	// to specify "Save As" nMode exactly
And the last flag chooses how the operation should be executed:

Code: Select all

if ((nFlags & PXV_DocSave_Sync) == 0)
	hRes = m_pInst->AsyncDoAndWaitForFinish(pSaveOp, nOpExecFlags);
else
	hRes = pSaveOp->Do(nOpExecFlags);
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
zarkogajic
User
Posts: 1370
Joined: Thu Sep 05, 2019 12:35 pm

Re: Default SaveTo Folder for cmd.saveAs / cmd.saveCopyAs -> 'Docs.Save.SaveAsFolderType' ignored for IStream open docum

Post by zarkogajic »

Hi Alex,

Thanks.

Your code hints there's some kind of document save related IOperation ("pSaveOp") ?

I'm using plain IPXV_Document.Save method - does it internally call some "op.saveDoc" ?


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

Re: Default SaveTo Folder for cmd.saveAs / cmd.saveCopyAs -> 'Docs.Save.SaveAsFolderType' ignored for IStream open docum

Post by Sasha - Tracker Dev Team »

Hello zarkogajic,

Yes, we do have an internal save operation that is being called from the save method.
There are plenty of events to tweak what is happening from the SDK, but no direct access to that operation.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Default SaveTo Folder for cmd.saveAs / cmd.saveCopyAs -> 'Docs.Save.SaveAsFolderType' ignored for IStream open documents

Post by Sasha - Tracker Dev Team »

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