op.bookmarks.export / op.bookmarks.import via IStream : "the parameter is incorrect" exception  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

op.bookmarks.export / op.bookmarks.import via IStream : "the parameter is incorrect" exception

Post by zarkogajic »

Hi Support,

I'm trying to copy all bookmarks from one core document to another.

I thought of using op.bookmarks.export / op.bookmarks.import while storing the bookmarks in an IStream.

The SDK Help for op.bookmarks.import states that IStream is an acceptable source. However, IStream is not listed as acceptable export location for op.bookmarks.export.

I have tried using IStream instance for the "ExportTo" parameter but "The parameter is incorrect" exception is being raised.

Can I export bookmarks to an IStream and use it for import?

Any other idea how to copy all bookmarks from one document to another (without writing to the filesystem)?

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

Re: op.bookmarks.export / op.bookmarks.import via IStream : "the parameter is incorrect" exception

Post by zarkogajic »

Hi Support,

I've "solved" my case by using IAFS_Name and deleting the file at the end.

Still, the question remains: can IStream be used (actually a memory stream) ?

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

Re: op.bookmarks.export / op.bookmarks.import via IStream : "the parameter is incorrect" exception

Post by Sasha - Tracker Dev Team »

Hello zarkogajic,

From what I see, the IStream can be used for import, but cannot be used for export. Thus the failure on your side.

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

Re: op.bookmarks.export / op.bookmarks.import via IStream : "the parameter is incorrect" exception

Post by zarkogajic »

HI Alex,

Thanks. Would it be possible (aka feature request) to allow for IStream (memory stream to be precise) for the ExportTo parameter?

That way, no need for a physical file on the filesystem during export/mport...

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

Re: op.bookmarks.export / op.bookmarks.import via IStream : "the parameter is incorrect" exception

Post by Sasha - Tracker Dev Team »

Hello zarkogajic,

Implemented. This will be available from the next release.

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:

op.bookmarks.export / op.bookmarks.import via IStream : "the parameter is incorrect" exception

Post by Sasha - Tracker Dev Team »

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

Re: op.bookmarks.export / op.bookmarks.import via IStream : "the parameter is incorrect" exception

Post by zarkogajic »

Hi Alex,

Using IStream for op.bookmarks.export (['Options']['ExportTo']) now (v353) is accepted and works - the memory stream is filled with some data.

However, when I use the same IStream instance for op.bookmarks.import (['Options']['ImportSource']), the Do() method raises an AV (nothing meaningful in terms of FormatHRESULT)


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

Re: op.bookmarks.export / op.bookmarks.import via IStream : "the parameter is incorrect" exception

Post by Sasha - Tracker Dev Team »

Hello zarkogajic,

Probably the problem is in the stream implementation itself?

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

Re: op.bookmarks.export / op.bookmarks.import via IStream : "the parameter is incorrect" exception

Post by zarkogajic »

Hi Alex,

I'm using the IStream implementation from my framework (Delphi's TStreamAdapter) - and it works without issues when, for example, using it to open files from IStream.

Also, saving to IStream works - I see data inside.

Only reading from it results in AV - and without any further exception details - I cannot dig into if the problem is on my side...

p.s.
I've tried with StringStream and MemoryStream (both wrapped into IStream via TStreamAdapter).

-žarko
User avatar
Vasyl-Tracker Dev Team
Site Admin
Posts: 2352
Joined: Thu Jun 30, 2005 4:11 pm
Location: Canada

Re: op.bookmarks.export / op.bookmarks.import via IStream : "the parameter is incorrect" exception

Post by Vasyl-Tracker Dev Team »

Hi Zarko.

Reviewed the code and found a bug that prevents using IStream/IAFS_File as input for ImportBookmarks-operation. :(
Will fix it in the next build.

Cheers.
Vasyl Yaremyn
Tracker Software Products
Project Developer

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
zarkogajic
User
Posts: 1370
Joined: Thu Sep 05, 2019 12:35 pm

Re: op.bookmarks.export / op.bookmarks.import via IStream : "the parameter is incorrect" exception  SOLVED

Post by zarkogajic »

Hi Vasyl,

Thanks.

-žarko
Post Reply