Shared Images in Header and Footer

Public forum for discussing TScaleRichView (shareware addon to TRichView providing WYSIWYG editing)
Post Reply
Tavo
Posts: 114
Joined: Sat Sep 24, 2005 9:25 pm
Location: Buenos Aires, Argentina
Contact:

Shared Images in Header and Footer

Post by Tavo » Mon Feb 29, 2016 6:18 pm

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

Post by Tavo » Tue Mar 08, 2016 3:20 pm

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: 14080
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko » Wed Mar 09, 2016 7:05 pm

Sorry for the delay, I'll check this problem tomorrow.

Sergey Tkachenko
Site Admin
Posts: 14080
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko » Thu Mar 10, 2016 1:12 pm

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

Post by Tavo » Thu Mar 10, 2016 8:15 pm

Now it works perfectly. It was what I was needing.
As always, thank Sergey.

Tavo
Posts: 114
Joined: Sat Sep 24, 2005 9:25 pm
Location: Buenos Aires, Argentina
Contact:

Post by Tavo » Fri Mar 11, 2016 2:45 pm

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: 14080
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko » Fri Mar 11, 2016 3:02 pm

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

Post by Tavo » Fri Mar 11, 2016 3:20 pm

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

Shared Images in Header and Footer

Post by Sentorolar » Mon Sep 24, 2018 3:34 pm

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