you trying

final Meta officeMetadata = spreadsheetDocument.getOfficeMetadata();
            officeMetadata.setDescription(descricao);
            officeMetadata.setCreationDate(Calendar.getInstance());
            officeMetadata.setTitle(titulo);
            officeMetadata.setSubject(assunto);
            officeMetadata.setInitialCreator(dono);
            final Table tabela =
spreadsheetDocument.appendSheet(nomeTabela);
            tabela.setTableName(nomeTabela);
            aplicarestilos();
            final StyleMasterPageElement defaultPage =
spreadsheetDocument.getOfficeMasterStyles().getMasterPage("Default");
            final OdfStylePageLayout pageLayout =
defaultPage.getAutomaticStyles().getPageLayout(defaultPage.getStylePageLayoutNameAttribute());

pageLayout.setProperty(OdfPageLayoutProperties.PrintOrientation,
"landscape");
            pageLayout.setProperty(OdfPageLayoutProperties.PageHeight,
"210mm");
            pageLayout.setProperty(OdfPageLayoutProperties.PageWidth,
"297mm");
            pageLayout.setProperty(OdfPageLayoutProperties.MarginLeft,
"10.5mm");
            pageLayout.setProperty(OdfPageLayoutProperties.MarginRight,
"5.0mm");
            pageLayout.setProperty(OdfPageLayoutProperties.MarginBottom,
"5.0mm");
            pageLayout.setProperty(OdfPageLayoutProperties.MarginTop,
"5.0mm");
            pageLayout.setProperty(OdfPageLayoutProperties.NumFormat, "1");

Atenciosamente,

Rafael Nunes
I'm free - Linux
Linux User #439174
http://www.linkedin.com/in/mederafael

On Thu, Oct 2, 2014 at 11:14 AM, Chuck Davis <[email protected]> wrote:

> Can anybody give me a hint how to set page size, orientation, margins
> and tabs using either the simple api or ODFDOM?  Based on my research
> I think it's in styles someplace but beyond that I'm lost as to how to
> set things.
>
> I have been using pdf for my Java reporting but the stupid things
> Adobe is doing these days is motivating me to change to a standards
> based reporting format.
>
> I find, however, the documentation is quite scanty and so far have
> been unsuccessful at deciphering how to get the basics done.  I AM
> impressed with how easy this project makes writing reports but
> formatting them...no so much.  I can write the reports and open them
> with AOO to do the formatting but these days users are going to think
> that is antiquated!
>
> Any direction will be appreciated.  A one-liner how to get to the page
> size setting for a text document would probably be sufficient for me
> to learn the rest.  (The api documentation appears to be quite good).
>
> Thanks much.
>

Reply via email to