Hi James Ma,

the reason for the different positions of the rectangles is that the layout of a text document is adjusted to the size of the application window. Depending on the application window size and the chosen zoom, the pages of a text document are positioned centered in the corresponding area. If the application window size is large enough respectively the chosen zoom is small enough, two or more pages of a text document are laid out side by side.

When exporting to PDF the actual laid out text document is rendered to a certain output device to generate the PDF file. Thus, depending on the application window size and chosen zoom you will see different rectangle positions in method <PDFWriter::DrawRect(..)> for one text document.

Best regards, Oliver.

On 12/18/09 07:57, ??? wrote:
Hi

I was debuging the pdffilter in OOO310_m19, I created two documents by
clicking File>>New>>TextDocument. One document was named "Letter.odt" and
with Page format "Letter".the other document was named "A4.odt" and with
Page format "A4". Both documents were set with Margins Left:0.00",
Right:0.00", Top:0.00", Bottom:0.00".

I set a breakpoint in the following function.
void PDFWriter::DrawRect( const Rectangle& rRect )
{
    ((PDFWriterImpl*)pImplementation)->drawRectangle( rRect );
}

Then there was something intersting in parameter rRect, rRect had differenct
values in these two documents,
"Letter.odt":   rRect{nLeft=3135 nTop=568 nRight=15373 nbottom=16406}
"A4.odt":        rRect{nLeft=3303 nTop=568 nRight=15207 nbottom=17404}

I thought "nLeft" and "nTop" should have the same value for both documents,
but actually they didn't .

The most weird is I created two documents on a diffenent machine with the
same document title, same page format and same mragins, and got a different
value:
"Letter.odt":   rRect{nLeft=1348 nTop=568 nRight=13586 nbottom=16406}
"A4.odt":        rRect{nLeft=1514 nTop=568 nRight=13422 nbottom=17400}

Does anyone explain why ?

Thanks
James Ma



--
=======================================================================
Sun Microsystems GmbH    Oliver-Rainer Wittmann
Nagelsweg 55             Software Engineer - OpenOffice.org/StarOffice
20097 Hamburg
Germany                  Fax:   (+49 40) 23 646 955
http://www.sun.de        mailto:oliver-rainer.wittm...@sun.com
-----------------------------------------------------------------------
Sitz der Gesellschaft:
Sun Microsystems GmbH, Sonnenallee 1, D-85551 Kirchheim-Heimstetten
Amtsgericht Muenchen: HRB 161028
Geschaeftsfuehrer: Thomas Schroeder, Wolfgang Engels, Wolf Frenkel
Vorsitzender des Aufsichtsrates: Martin Haering

=======================================================================
Oliver-Rainer Wittmann (od) - OpenOffice.org Writer
OpenOffice.org Engineering at Sun: http://blogs.sun.com/GullFOSS

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@openoffice.org
For additional commands, e-mail: dev-h...@openoffice.org

  • [dev] [PDFFI... 马珍杰
    • Re: [de... Oliver-Rainer Wittmann - Software Engineer - Sun Microsystems

Reply via email to