WPCubed Product Support

Setting the Page Size and Margins

Sometimes I can't find how to do simple stuffs too. For example, to set the initial values for the editor (width, height, pagesize, etc), I had to manually set these using the rulers (horizontal e vertical), then save a document, and then everytimes I open the editor I load this document.

One simple thing I'm trying to find out how to do is reduce the height of the ununsed area in the editor:

🖼 www.louman.com.br

I want the vertical ruler to go to 30 not to pass 33, but I can't find where to set it.

#1 ♥ 0
9k Views 2 links 2 users read 3 min
support

This is the intro chaper in the manual:
[](http://www.wpcubed.com/manuals/wp5man/quick.htm)

The printer setup reflects the paper size chosen in the property header. There is is possible to select a default page size, DinA4 for example. The default for RTF is letter. The dafault is applied to new documents, not current document. Thgat is what PageSize is for.

Once you change the default page size the printer parameter do not have to be updated anymore.

What You mean ins "BottomMargin".

A page has 4 margins,
Left, Right, Top, Bottom

Together with PageWidth, PageHeight that defines the page size and printable area.

MarginHeader and MarginFooter define the minimum distance of the page footer text or header text to the borders.

Those properties are all in the sub property Header - see link to manual above - and modify the current document.

The property DefaultPageWidth etc set the values which are applied when the editor is cleared (= new document).

Method SetPageWH can be used to set several values at once, the values which should not be changed can be passed as -1

#2 ✎ ♥ 0

I tried to set it with:

  • WPRichText.Header.MarginHeader := 0;
  • WPRichText.Header.MarginFooter := 0;

But nothing happens, I tried also to set it in design time, but still nothing happens, what am I missing?

#3 ♥ 0
support

Hi,

WPRichText.Header.MarginHeader, MarginFooter must be set at runtime.

At Designtime only the "Default" can be set.

Please note, that the TWPRichText dies not "own" the text. 2 or more TWPRichText can work on the same text, this special feature makes some things more complicated that expected, but, on the other hand, is very important and powerful.

Many designtime properties are applied by the procedure "Loaded". That is called by the VCL at some time.

Julian

#4 ♥ 0

Thats what I did, theres a WPRichText on that form:

procedure Tfrm_ri_modelos_editor.FormCreate(Sender: TObject);
begin
WPRichText.Header.MarginFooter := 0;
WPRichText.Loaded;
end;

Still nothing happen, I cant find to remove the unused part of the footer.

#5 ♥ 0

Well I was able to do that by:

with WPRichText.Header do
    SetPageWH(PageWidth,PageHeight-2000,
      LeftMargin,RightMargin,TopMargin,BottomMargin-2000);

I dont think its the best way but it was the only way which worked.

#6 ♥ 0
support

@Kym:
Thats what I did, theres a WPRichText on that form:

procedure Tfrm_ri_modelos_editor.FormCreate(Sender: TObject);
begin
WPRichText.Header.MarginFooter := 0;
WPRichText.Loaded;
end;

Still nothing happen, I cant find to remove the unused part of the footer.

MarginFooter and MarginHeader is the distance of the header/footer to the page borders (as mentioned).

What You want to modify is TopMargin and BottomMargin

Julian

#7 ♥ 0
This category is archived. No new posts are possible.