SRVE Changes page orientation after TsrvActionPrint executin

ScaleRichView support and discussion (TRichView add-on for WYSIWYG editing)
Post Reply
vit
Posts: 115
Joined: Tue Feb 03, 2009 3:11 pm

SRVE Changes page orientation after TsrvActionPrint executin

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

Post 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)
vit
Posts: 115
Joined: Tue Feb 03, 2009 3:11 pm

Post by vit »

I've just tried it didn't help (both TrvActionSave and TsrvActionPrint are on a TDataModule)
Sergey Tkachenko
Site Admin
Posts: 17553
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Is it possible to reproduce the problem in a simple project?
Sergey Tkachenko
Site Admin
Posts: 17553
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post 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.
vit
Posts: 115
Joined: Tue Feb 03, 2009 3:11 pm

Post 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
vit
Posts: 115
Joined: Tue Feb 03, 2009 3:11 pm

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

Post 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.
Daisyvop
Posts: 1
Joined: Fri May 03, 2019 8:48 pm
Location: Panama
Contact:

SRVE Changes page orientation after TsrvActionPrint executin

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

Re: SRVE Changes page orientation after TsrvActionPrint executin

Post by Sergey Tkachenko »

Sorry, different margins for different pages are not implemented yet.
Post Reply