Hello,
On create new document I like to do this : (if possible)
1-Set page size 8.5 x11 inch.
2-Add page break or line on inch 10 (leave one inch on the bottom for my footer). or disable any entry after inch 10, something like that
Thank you
page break
-
- Site Admin
- Posts: 17555
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Re: page break
Do you use TSRichViewEdit (ScaleRichView) or TRichView/TRichViewEdit?
Re: page break
Hello,
I use TRichViewEdit
Thank you
I use TRichViewEdit
Thank you
-
- Site Admin
- Posts: 17555
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Re: page break
TRichViewEdit itself does not have a page size, it represents a single bottomless page.
A page size appears when printing or when exporting to RTF/DocX.
For printing, TRichViewEdit uses the current printer settings.
So, if you want to print on 8.5 x 11 inch ("letter" format), you need to assign this format on the current printer.
The example is here: https://www.trichview.com/forums/viewto ... tPaperSize
Call SetPaperSize(DMPAPER_LETTER).
For export to RTF/DocX, assign the proper size to RichViewEdit.DocParameters.PageWidth and PageHeight, and include rvrtfSaveDocParameters in RichViewEdit.RTFOptions.
Now, you need to reserve space for footer.
You can set the bottom margin = 1 inch. And you can define the bottom coordinate of the footer.
For printing, it is RVPrint.Margins.Bottom and RVPrint.FooterY.
For export to RTF/DocX, it is RichViewEdit.BottomMargin and FooterY.
See the schemes in https://www.trichview.com/help/idh_class_trvprint.html
A page size appears when printing or when exporting to RTF/DocX.
For printing, TRichViewEdit uses the current printer settings.
So, if you want to print on 8.5 x 11 inch ("letter" format), you need to assign this format on the current printer.
The example is here: https://www.trichview.com/forums/viewto ... tPaperSize
Call SetPaperSize(DMPAPER_LETTER).
For export to RTF/DocX, assign the proper size to RichViewEdit.DocParameters.PageWidth and PageHeight, and include rvrtfSaveDocParameters in RichViewEdit.RTFOptions.
Now, you need to reserve space for footer.
You can set the bottom margin = 1 inch. And you can define the bottom coordinate of the footer.
For printing, it is RVPrint.Margins.Bottom and RVPrint.FooterY.
For export to RTF/DocX, it is RichViewEdit.BottomMargin and FooterY.
See the schemes in https://www.trichview.com/help/idh_class_trvprint.html
Re: page break
Thank you,
I did all that, but unfortunately, I'm unable to stop the user from typing even after 11 inch paper length.
all I need to force the user from exceeding the paper size, if exceeded the user will need to create new document,
I'm able to stop the user on the width by adding MaxTextWidth.
Thank you again for your time
I did all that, but unfortunately, I'm unable to stop the user from typing even after 11 inch paper length.
all I need to force the user from exceeding the paper size, if exceeded the user will need to create new document,
I'm able to stop the user on the width by adding MaxTextWidth.
Thank you again for your time
-
- Site Admin
- Posts: 17555
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Re: page break
The only solution that I can imagine is reformatting TRVPrint when the user edits the document (call RVPrint1.FormatPages in RichViewEdit1.OnChange), and if RVPrint1.PagesCount > 1, call RichViewEdit1.Undo.