Page 1 of 1

SRVE Changes page orientation after TsrvActionPrint executin

Posted: Sun Jan 15, 2017 12:27 pm
by vit
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!

Posted: Sun Jan 15, 2017 7:45 pm
by Sergey Tkachenko
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)

Posted: Mon Jan 16, 2017 4:56 am
by vit
I've just tried it didn't help (both TrvActionSave and TsrvActionPrint are on a TDataModule)

Posted: Mon Jan 16, 2017 7:00 am
by Sergey Tkachenko
Is it possible to reproduce the problem in a simple project?

Posted: Mon Jan 16, 2017 7:56 am
by Sergey Tkachenko
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.

Posted: Mon Jan 16, 2017 8:18 am
by vit
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

Posted: Tue Jan 17, 2017 6:53 am
by vit
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

Posted: Fri Jan 20, 2017 3:18 pm
by Sergey Tkachenko
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.

SRVE Changes page orientation after TsrvActionPrint executin

Posted: Tue May 21, 2019 9:49 am
by Daisyvop
Hi
Is there way to set in SRVE different margins for different pages after page break?
In Page Setup form is possible to set margins for entire document only.
Thanks

Re: SRVE Changes page orientation after TsrvActionPrint executin

Posted: Tue May 21, 2019 11:39 am
by Sergey Tkachenko
Sorry, different margins for different pages are not implemented yet.