PDA

View Full Version : How can i set the layout of a page to be Landscape in an ODF document?



coss_cat
8th December 2012, 05:39
Hello everyone,

I'm trying to figure it out how to set the layout of an ODF doc to landscape instead of portrait, and until now no results.

Does anyone has any clue on this?

Regards,

Coss_cat

CODE of cpp file(the .h contains all necessary; the code compiles well):


m_document = new QTextDocument();
QSizeF size;
size.setHeight(225);
size.setWidth(300);
m_document->setPageSize(size);

// Cursor for traversing the document
m_cursor = QTextCursor(m_document);
//use the cursor to write things

//blah blah blah

QTextDocumentWriter writer;
writer.setFormat("odt");
writer.setFileName(docfilename.toAscii());
writer.write(m_document);

krasnoiark
13th October 2017, 15:02
Hi,
I wish to know if you have found a way, I am currently trying to do the same thing but I can't manage.

geekowl
20th October 2017, 14:38
You can use QPdfWriter or QPrinter to handle pagelayout or orientation.