Shared Images in Header and Footer

ScaleRichView support and discussion (TRichView add-on for WYSIWYG editing)
Post Reply
Tavo
Posts: 175
Joined: Sat Sep 24, 2005 9:25 pm
Location: Buenos Aires, Argentina
Contact:

Shared Images in Header and Footer

Post 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
Tavo
Posts: 175
Joined: Sat Sep 24, 2005 9:25 pm
Location: Buenos Aires, Argentina
Contact:

Post 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
Sergey Tkachenko
Site Admin
Posts: 17522
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Sorry for the delay, I'll check this problem tomorrow.
Sergey Tkachenko
Site Admin
Posts: 17522
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post 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;
Tavo
Posts: 175
Joined: Sat Sep 24, 2005 9:25 pm
Location: Buenos Aires, Argentina
Contact:

Post by Tavo »

Now it works perfectly. It was what I was needing.
As always, thank Sergey.
Tavo
Posts: 175
Joined: Sat Sep 24, 2005 9:25 pm
Location: Buenos Aires, Argentina
Contact:

Post 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
Sergey Tkachenko
Site Admin
Posts: 17522
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post 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.
Tavo
Posts: 175
Joined: Sat Sep 24, 2005 9:25 pm
Location: Buenos Aires, Argentina
Contact:

Post 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!!!!!!!
Sentorolar
Posts: 3
Joined: Tue Sep 11, 2018 2:29 pm
Location: Czech
Contact:

Shared Images in Header and Footer

Post 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
Post Reply