[Solved] [Writer] Get page format settings

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
User avatar
Mr.Dandy
Posts: 427
Joined: Tue Dec 11, 2012 4:22 pm

[Solved] [Writer] Get page format settings

Post by Mr.Dandy »

Hello all,

In Format / Page menu, we have this list:
Capture.PNG
Where can I find this setting?
Last edited by Mr.Dandy on Fri Jul 26, 2019 9:22 am, edited 1 time in total.
OpenOffice 4.1.12 - Windows 10
User avatar
RoryOF
Moderator
Posts: 34586
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: [Writer] Get page format settings

Post by RoryOF »

I'm not sure what your question is: note that in /File /Print you need to press the Properties button and in the dialog that opens select that same paper size to tell the printer to use that paper size (and of course, you need to insert such size of paper into the printer).
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
User avatar
Lupp
Volunteer
Posts: 3542
Joined: Sat May 31, 2014 7:05 pm
Location: München, Germany

Re: [Writer] Get page format settings

Post by Lupp »

Did you read (e.g.)
5.10.1. Setting the paper size
of "Useful Macro Information" by Andrew Pitonyak?

(I don't know how to manipulate the Orientation. From my experiences: It is not adapted automatically. In the dialog it acts as a tool to exchange the With/Height values. However, if you cange the Size by macro, the dialogue remembers the Orientation as it was before.)

Amendment:
The Orientation is saved in the Boolean attribute .IsLandscape .
Last edited by Lupp on Thu Jun 13, 2019 8:49 pm, edited 1 time in total.
On Windows 10: LibreOffice 24.2 (new numbering) and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
User avatar
RoryOF
Moderator
Posts: 34586
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: [Writer] Get page format settings

Post by RoryOF »

This thread wil give you a macro that may get you on your way if you wish to set page formats by macro
viewtopic.php?f=20&t=82036
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
User avatar
Mr.Dandy
Posts: 427
Joined: Tue Dec 11, 2012 4:22 pm

Re: [Writer] Get page format settings

Post by Mr.Dandy »

Thanks all for your replies
RoryOF wrote:This thread wil give you a macro that may get you on your way if you wish to set page formats by macro
viewtopic.php?f=20&t=82036
This thread show that we have only a format with height and width values.
I try to get the real name (letter, legal, A4, A5...).
OpenOffice 4.1.12 - Windows 10
User avatar
RoryOF
Moderator
Posts: 34586
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: [Writer] Get page format settings

Post by RoryOF »

Andrew Pitonyak, in OpenOffice Macros Explained, listing 317, gives code to retrieve the names of the Paper types.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
User avatar
Mr.Dandy
Posts: 427
Joined: Tue Dec 11, 2012 4:22 pm

Re: [Writer] Get page format settings

Post by Mr.Dandy »

Thanks for the hint

Enum PaperFormat do the job: https://www.openoffice.org/api/docs/com ... ormat.html
OpenOffice 4.1.12 - Windows 10
Post Reply