SRVE Changes page orientation after TsrvActionPrint executin

Public forum for discussing TScaleRichView (shareware addon to TRichView providing WYSIWYG editing)
Post Reply
vit
Posts: 114
Joined: Tue Feb 03, 2009 3:11 pm

SRVE Changes page orientation after TsrvActionPrint executin

Post by vit » Sun Jan 15, 2017 12:27 pm

Hi!

1. I load RVF in SRVE (document has landscape orientation)
2. Click Print button (use TsrvActionPrint action)
3. In Print dialog click OK
4. Now document orientation is Portrait.

Not able to reproduce it in ActionTest but It happens in between 2. and 3. (I found it out with debugger) at the line

Code: Select all

FPageProperty.FOrientation := Orientation;
here is the stacktrace

Code: Select all

SclRView.TSRichViewEdit.SetRVMargins(False)
SclRView.TSRichViewEdit.Reformat
SclRView.TSRVPageProperty.SetPageFormat(srvfmA4)
SRVActions.TsrvCustomActionThatNeedsDocProps.SetMultipageLayout($1300AB20)
SRVActions.TsrvActionPrint.Print($1300AB20)
here are settings that are set in my SRVE

Code: Select all

  RVOptions := [rvoAllowSelection, rvoScrollToEnd, rvoAutoCopyText,
    rvoAutoCopyRVF, rvoAutoCopyImage, rvoAutoCopyRTF, rvoFormatInvalidate,
    rvoDblClickSelectsWord, rvoRClickDeselects];

  RTFOptions := [rvrtfDuplicateUnicode, rvrtfSaveEMFAsWMF, rvrtfSaveJpegAsJpeg,
    rvrtfSaveDocParameters];

  RTFReadProperties.UnicodeMode := rvruMixed;
  RTFReadProperties.TextStyleMode := rvrsAddIfNeeded;
  RTFReadProperties.ParaStyleMode := rvrsAddIfNeeded;
  RTFReadProperties.ReadDocParameters := True;
  RVFOptions := [rvfoSavePicturesBody, rvfoSaveControlsBody,
    rvfoIgnoreUnknownPicFmt, rvfoIgnoreUnknownCtrls,
    rvfoConvUnknownStylesToZero, rvfoConvLargeImageIdxToZero, rvfoSaveBinary,
    rvfoSaveBack, rvfoLoadBack, rvfoSaveTextStyles, rvfoSaveParaStyles,
    rvfoSaveLayout, rvfoLoadLayout, rvfoSaveDocProperties,
    rvfoLoadDocProperties];
SRV_VERSION = 'v7.2.1';
RVE: v16.3.1 (2015-Nov-6)
RVA: v6.2.1


Any thoughts what reason may be?

Thanks!

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

Post by Sergey Tkachenko » Sun Jan 15, 2017 7:45 pm

Do you have TrvActionSave?
It is necessary for ScaleRichView printing actions.

Even if you do not need TrvActionSave (for example, you store documents in a database instead of files), add it (and, if you do not need it to be executed, clear its Shortcut property)

vit
Posts: 114
Joined: Tue Feb 03, 2009 3:11 pm

Post by vit » Mon Jan 16, 2017 4:56 am

I've just tried it didn't help (both TrvActionSave and TsrvActionPrint are on a TDataModule)

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

Post by Sergey Tkachenko » Mon Jan 16, 2017 7:00 am

Is it possible to reproduce the problem in a simple project?

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

Post by Sergey Tkachenko » Mon Jan 16, 2017 7:56 am

As I understand, the problem happens when TSRichViewEdit in the method SetRVMargins synchronizes PageProperty and RichViewEdit.DocParameters (assigns Orientation from RichViewEdit.DocParameters to PageProperty).

I do not understand why these orientations are different. When you load a file, the component first loads page properties in RichViewEdit.DocParameters, and then assigns them to PageProperty, so properties must be equal.

vit
Posts: 114
Joined: Tue Feb 03, 2009 3:11 pm

Post by vit » Mon Jan 16, 2017 8:18 am

I do not understand why these orientations are different. When you load a file, the component first loads page properties in RichViewEdit.DocParameters, and then assigns them to PageProperty, so properties must be equal.
Yes, it seems that orientations differ for some reason. I'm still unable to reproduce it, but I'm going to bring a file I load soon. Maybe it'll help

vit
Posts: 114
Joined: Tue Feb 03, 2009 3:11 pm

Post by vit » Tue Jan 17, 2017 6:53 am

Not sure if it may help but I brought two files.

First file is RVF I save just after opening a content in my SRVE http://webfiles.ru/files/45489279. It's disappointing that when I open it in ActionTest the page orientation is Portrait. Despite of the fact that it was saved with the Landscape and it had the Landscape orientation just after openning in my SRVE. Could you please find out which orientation is written inside the file?

And second file is RVF as well, I saved it just after printing http://webfiles.ru/files/45489280 when the orientation has been changed

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

Post by Sergey Tkachenko » Fri Jan 20, 2017 3:18 pm

This information can be seen in any text editor.

Page information is the same in table.rvf and table1.rvf:

Code: Select all

Units=1
PageHeight=29.7
PageWidth=21
LeftMargin=1.5
RightMargin=1.5
HeaderY=1
FooterY=1
For portrait orientation, the line
Orientation=1
must be there.

Post Reply