Lucky coincidence made me assume page rendering to a "headless" virtual device auto-scales...

Tor Lillqvist tml at iki.fi
Thu Jun 14 13:56:11 PDT 2012


I happen to use a virtual device of size 1024x1024 in my Android
document viewer test code. (Because it is such a nice round number;)

SvpSalGraphics::GetResolution() in vcl/headless/svpgdi.cxx sets DPIX =
rDPIY = 96. (This I hadn't noticed.)

So when I saw that document pages (page format A4 portrait) fit nicely
height-wise into my 1024x1024 bitmap, I naturally thought there is
some default automatic scaling happening, just as I had hoped...

But it was just a coincidence; A4's height of 297 mm at 96 pixel/in
turns out to be just a litle bit more than 1024... so only when I
added a footer with page number to my test doc and noticed that the
bottom of the page numbers was clipped did I realize something was
wrong.

So I guess what I would want to know now is if there already is some
code in there to do such automatic scaling of each page as it is
rendered to fit the output device? By passing some suitable property
to XRenderable::render() or something?

But I guess I need to do it manually, and to handle scaling and
offsetting (to zoom in) I need to touch the ~same bits of code anyway.

--tml


More information about the LibreOffice mailing list