Page 1 of 1

specific the image name in savehtml

Posted: Thu Feb 24, 2011 5:20 pm
by noibird
Hi,

I want to use savehtml(or savestream), and I need to specific the image name. But I found savehtml only can save the image with a name:prefix+num.

Is there any way to save the image with a specific name?

Any help is appericate.

Posted: Thu Feb 24, 2011 8:07 pm
by Sergey Tkachenko
You can specify the image file name in the item properties.
See rvespImageFileName in http://www.trichview.com/help/idh_type_ ... perty.html
If rvsoUseItemImageFileNames is included in the Options parameter of SaveHTML/SaveHTMLEx, images with defined (non-empty) file names will not be saved, but their file names will be written in HTML (paths will be converted to relative paths).

If you need something different, you can use OnHTMLSaveImage or OnSaveImage2 events.

Posted: Fri Feb 25, 2011 2:42 pm
by noibird
Thanks!
I've add rvsoUseItemImageFileNames to Options parameter of SaveHTML, but in HTML the images' name are also prex+num. I specific the images' name like this: rve->InsertPicture("name", gr, rvvaBaseline). Is it right way to specific the image's name?

I search the whol forum, I coudn't find a sample code for OnSaveImage2 event to help me fix this problem. Is there a sample for it?

Any help is appericate.

Posted: Sat Feb 26, 2011 7:12 pm
by noibird
help.......................

Posted: Sun Feb 27, 2011 2:56 pm
by Sergey Tkachenko
The first parameter of InsertPicture is an "item name", it is not used by the component itself. rvespImageFileName is assigned differently.
To make insertion and assigning this property a single operation, undo records must be grouped.

Code: Select all

rve->TopLevelEditor->BeginUndoGroup(rvutInsert);
rve->TopLevelEditor->SetUndoGroupMode(true);
if (rve->InsertPicture("name", gr, rvvaBaseline))
  rve->SetCurrentItemExtraStrProperty(rvespImageFileName, ImageFileName, true);
rve->TopLevelEditor->SetUndoGroupMode(false);

Posted: Mon Feb 28, 2011 1:36 pm
by noibird
Thank you very much :D