Page 1 of 1

Shared Images in Header and Footer

Posted: Mon Feb 29, 2016 6:18 pm
by Tavo
Hello!

Not yet know if what I'm doing is right, I need someone to advise me.
My application stores documents in RVF format, these documents use shared images, (I exclude rvfoSavePicturesBody of RVFOptions and use OnRVFPictureNeedded to enter the graph is stored in another table)
To save space, no pictures or headers or footers are stored in the document table.
Everything works fine until this point.
The problem is that the headers and footers, which are stored in another table, also use shared images. But I am not able to make shared images appear in the headers and footers
If I load the header in main document of SRichViewEdit (SRichViewEdit1.RichViewEdit) the graphic appear. If I load the header in a corresponding document of SRichViewEdit (SRichViewEdit1.RVHeader) the graphic disappears.
At the start I do these assignments:

Code: Select all

 SRichViewEdit1.RichViewEdit.RVFOptions := [rvfoSaveBinary,rvfoSaveTextStyles,rvfoSaveParaStyles,rvfoSaveDocProperties,rvfoLoadDocProperties] ;
 SRichViewEdit1.RVHeader.RVFOptions     := [rvfoSaveBinary,rvfoSaveTextStyles,rvfoSaveParaStyles,rvfoSaveDocProperties,rvfoLoadDocProperties] ;
 SRichViewEdit1.RVFooter.RVFOptions     := [rvfoSaveBinary,rvfoSaveTextStyles,rvfoSaveParaStyles,rvfoSaveDocProperties,rvfoLoadDocProperties] ;

// Same handler to 3 RichViewEdit
 SRichViewEdit1.RichViewEdit.OnRVFPictureNeeded := SRichViewEdit1RVFPictureNeeded ;
 SRichViewEdit1.RVHeader.OnRVFPictureNeeded     := SRichViewEdit1RVFPictureNeeded ;
 SRichViewEdit1.RVFooter.OnRVFPictureNeeded     := SRichViewEdit1RVFPictureNeeded ;
What am I doing wrong? Could you please give me a clue about how to go to get what I want.
Thank you very much for reading and sorry for my bad English

Posted: Tue Mar 08, 2016 3:20 pm
by Tavo
Hi there!!! It´s me again. :D
Perhaps it is not possible to do what I want and I can only use shared images in the body of the document but not in the subdocuments.
If it's possible, I am not able to do it. I must be doing something wrong.
I would appreciate any clues that might give me.
Sorry for my bad English.
Thanks

Posted: Wed Mar 09, 2016 7:05 pm
by Sergey Tkachenko
Sorry for the delay, I'll check this problem tomorrow.

Posted: Thu Mar 10, 2016 1:12 pm
by Sergey Tkachenko
1) Do not assign events and properties of the sub-editors.
Assign SRichViewEdit1.RVFOptions and SRichViewEdit1.OnRVFPictureNeeded instead.
You can do it in code or at design time (in the Object Inspector).

2) There is a bug, some sub-editors do not process this event.
Quick fix:
- open SclRView.pas.
- find the line:

Code: Select all

  RVHFPaint.OnItemAction := HookOnItemAction;
and add after:

Code: Select all

  RVHFPaint.OnRVFPictureNeeded := HookOnRVFPictureNeeded;
- find the line:

Code: Select all

  RVNPaint.OnItemAction := HookOnItemAction;
and add after:

Code: Select all

  RVNPaint.OnRVFPictureNeeded := HookOnRVFPictureNeeded;

Posted: Thu Mar 10, 2016 8:15 pm
by Tavo
Now it works perfectly. It was what I was needing.
As always, thank Sergey.

Posted: Fri Mar 11, 2016 2:45 pm
by Tavo
Hello Sergey. It's me again....
There is a small problem ... If I assign handler at design time everything works perfectly. But if I do it in design-time handlers of subdocuments are being worth nil (or keep the handler assigned at design time). I would need assign it by code to share the same handler in several SRV.
Sorry for my english.
Thanks again

Posted: Fri Mar 11, 2016 3:02 pm
by Sergey Tkachenko
Please give me step-by-step instructions how to reproduce this problem.
I tested this feature yesterday by assigning event handler at design time.

Posted: Fri Mar 11, 2016 3:20 pm
by Tavo
Sergey, you are rigth!!!!!

The instructions how to reproduce this problem is

Code: Select all

SRichViewEdit1.RichViewEdit.OnRVFPictureNeeded := RV_UtilLT.DummySRV.LTPictureNeeded
The instructions how to fix it is

Code: Select all

SRichViewEdit1.OnRVFPictureNeeded := RV_UtilLT.DummySRV.LTPictureNeeded
:oops: :oops: :oops: :oops: :oops: :oops: :oops:

:oops: :oops: :oops: :oops: :oops: :oops: :oops: :oops: :oops: :oops:

Thanks again!!!!!!!

Shared Images in Header and Footer

Posted: Mon Sep 24, 2018 3:34 pm
by Sentorolar
Hi,
I tried the demo,
two information:

1 How can I change header and footer
2 I only export camera 1 and not the 2, 3 etc ...

sorry my English is not perfect