PDFMatrix mat = new PDFMatrix(m_scale, -m_scale, 0, m_dibh);
In which units should m_dibh be specified? I discovered that if I put my document's height converted to device-independent pixels (DIP), the generated image is positioned too low.
When trying to render a 1405 x 1987 image, with the identity matrix, the point x: 0, y: 0 in not in the left bottom corner but somewhere on the left edge.
m_dibw = m_scale * Page.Width;//Page.Width is in PDF coordinate.
m_dibh = m_scale * Page.Height//Page.Height is in PDF coordinate.
Matrix mat = new Matrix( m_scale, -m_scale, 0, m_dinh );
m_dib_tmp = new WriteableBitmap(m_dibw, m_dibh);
int[] pixels = m_dib_tmp.Pixels;
Page.Render(pixels, m_dibw, m_dibh, mat, true, PDFView.renderQuality);